7_a06a
Last Updated: February 25, 2016
·
1.271K
· sheerun
Photo on 08.01.2013 at 04.15

Ignore changes in tracked files

git

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.

Say Thanks
Respond

3 Responses
Add your response

4608

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 ·
4609
Photo on 08.01.2013 at 04.15

Because every time you checkout -f or git reset, you lose changes in that file

over 1 year ago ·
4643
D3a5ecc360da791277fc3807c51a0190

Awesome! Thanks!

over 1 year ago ·