To make my project work locally I have to change one file. But this file has to be unchanged in the remote. How do I make git ignore the changes in this file when using git status
, git add
and git stash
command?
What I tried:
1.
git update-index --assume-unchanged filename
makes it work with 'git status' and 'git add', but 'git stash'+'git stash pop' restores the file to the original state, breaking my local setup.
2. I found this solution, but it changes remote as well, which I don't want to: https://www.codeblocq.com/2016/01/Untrack-files-already-added-to-git-repository-based-on-gitignore/
3.
adding the file to .git/info/exclude
doesn't work, since it is a file from the repository, not a new file.