Another developer committed his local version of the .gitignore file. I want to modify that file locally without being nagged about it: no showing up on "git status", no "overwritten by checkout" errors.
The often-recommended solution seems to be "git update-index --assume-unchanged .gitignore"
This does not work.
It will indeed prevent the file from showing up in "git status", but it will trigger an error when changing branches:
error: Your local changes to the following files would be overwritten by checkout: .gitignore
More non-solutions:
- "Add .gitignore to .gitignore" => does nothing.
- "Add .gitignore to .git/info/exclude" => does nothing.
- "git rm --cached .gitignore" => .gitignore shows up on git status.
Other non-useful threads:
- http://stackoverflow.com/questions/767147/how-do-i-tell-git-to-ignore-gitignore
- http://stackoverflow.com/questions/10750351/git-hub-gitignore-error
So, my question, can this actually be done?
Thanks for your time.
EDIT
From Shahbaz', Chris' and jthill's helpful comments, I conclude that the answer to my question is "No". It looks like there is no built-in mechanism in git to completely ignore a tracked file locally. Fortunately, there are several workarounds that are situationally useful.
Thanks for the answers, guys.