A .gitignore
file allows to ignore files from version controlling them at all.
We have a different situation: we want to place in the repository some config
I define the following aliases in my .gitconfig
file:
[alias]
ignore = update-index --assume-unchanged
unignore = update-index --no-assume-unchanged
That should do exactly what you want: running git ignore some-file
will treat the file as unchanged no matter what you do to it, until you run git unignore some-file
.