Add a file to a git repository but ignore future changes on it

After adding the file you can ignore all further changes by doing:

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

If at some point you decide that you need to push more changes you can allow again changes by doing:

git update-index --no-assume-unchanged path/to/file

Instead of adding the files in the repo, why not ignore them and add them to a different location, eg. a setup directory. This way after cloning the repo, the developers will need to execute an init step that will copy the needed files in the proper location, where they are ignored.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)