If I understand well you want filename
to be in the git repository. However you don't want to be notified of new changes to filename
. You can do this using this command:
git update-index --assume-unchanged <filename>
If you wanna start tracking changes again run the following command:
git update-index --no-assume-unchanged <filename>
additional info: editing .gitignore will only ignore files so they will not be added to the git repository. However files that are tracked already will not be ignored.