Ignore changes in tracked files
E.g. you don't want modified database.yml to be commited:
git update-index --assume-unchanged database.yml
The reverse operation is:
git update-index --no-assume-unchanged database.yml
Beware, it effects only local repository. You can't commit that.
Written by Adam Stankiewicz
Related protips
3 Responses
Nice and good to know. However, why not .gitignore it and commit -f?
You end up with same behavior (local changes ignored).
over 1 year ago
·
Because every time you checkout -f or git reset, you lose changes in that file
over 1 year ago
·
Awesome! Thanks!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#