I have a local file I need to be changed (an envvar for local environment detection) and don’t want it committed. Sure this is done elsewhere via say a local, silent import of a file outside of your repository.
In this case, it had to be in the the tracked file.
You can set certain things to be assumed as unchanged:
git update-index --assume-unchanged