You can set Git to assume certain files haven't changed even when they have (without adding them to your .gitignore
file). This way, it won't track changes to make to one (or multiple) files.
git update-index --assume-unchanged file
After this command is run, the repository continues tracking the file. It might have changes that git will want to commit.
git update-index --no-assume-unchanged file
--assume-unchanged
In case you made changes while --assume-unchanged
was on and don't want to keep the changes on the file: Roll-back to where the repository is when you want to pull or push changes.
git checkout -- file