Ignoring versioned files

Posted . Visible to the public.

Some files in a repository change often but are rarely committed. Usually, these are various local configuration files that are edited, but should never be committed upstream.

Git lets you ignore those files by assuming they are unchanged. This is done by running the following command:

git update-index --assume-unchanged path/to/file.txt

Once you mark a file like this, Git completely ignores any changes on it. It will never show up when running git status or git diff, nor will it ever be committed.

To make Git track the file again, simply run:

git update-index --no-assume-unchanged path/to/file.txt
kiatng
Posted by kiatng to Git (2014-05-05 12:56)