Last Updated: February 25, 2016
·
1.531K
· sheerun

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.

Read me.

3 Responses
Add your response

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 ·