Alessandro Ghedini /dev/random

Make git ignore changes to files

Just another nice feature of git(1) that I always forget about when I need it (it just happened)… posting it here, in the hope that it’ll get stuck in my head.

$ git update-index --assume-unchanged some_file

This will make git to stop tracking the changes to the given file, even if it has already been added to the repository index.

To revert it:

$ git update-index --no-assume-unchanged some_file

And voilà, as if nothing ever happened.