Git is an awesome beast of an SCM. Yet I am endlessly perplexed by an issue.
I have a config file which are in the .gitignore
and not in the master
branch on origin
(via git show -- config/mongo.yml
). However on my branch, which was checked out from origin/master
and worked on for a while, the file is being tracked somehow and when I git rm
and git checkout
out from origin/master
again, the files stay in my repo but disappear for everyone else on my team. I ran git rm --cached
as well, and as a last resort I ran:
git update-index --assume-unchanged -- config/mongo.yml
Which I have used many times to good effect on ignored files, and the branch was small enough to redo. However, this doesn't seem to be the fix. I really would just like to know the "why" of this and understand the problem, since that is 3/4 of the solution!! :)
How could I have it in my .gitignore
and then it shows up tracked after git rm config/mongo.yml
and git checkout origin/master -- config/mongo.yml
?