Recently I faced a situation, where I had to ignore some file with git.
But at the same time I can’t modify
.gitignore file in repo.
The solution for such situation is to list such ingnored files in
.git/info/exclude in the root of your repo.
This list will not be uploaded to remote repo, and nobody will see it, so it is absolutely local.