Usually ignoring files is quite simple with Git. However, you may need to quickly hide changes in a file, perhaps for an entire development session or other reasons. Luckily there’s a simple way around this, thanks to some clever manual diving from Eelco Wiersma.
His main problem was using git commit -a, which automatically adds files that are modified into the commit object. This is a neat shortcut, but make sure you understand the staging area if you find yourself running this command all the time.
So, to temporarily ignore changes in a certain file, run:
git update-index –assume-unchanged
Then when you want to track changes again:
git update-index –no-assume-unchanged
via git ready » temporarily ignoring files.
Advertisements