.gitignore not working after adding it to already modified repo.
Possible Duplicate:
.gitignore file not ignoring
I checked out a big repo and worked on it for a day which created lot of temp files. When I cloned the repo, I forgot to add .gitignore to it. So, now I see lot of temp files. I added my .gitignore to the root directory. Also copied the same rules to /.git/info/exclude. Still I see the same set of files. Am I doing some stupid mistake?
Thanks
did you untrack those temp files after adding the .gitignore?
from github,
Note that git will not ignore a file that was already tracked before a rule was added to this file to ignore it. In such a case the file must be un-tracked, usually with git rm --cached filename
To first remove the cached contents
git rm -r --cached
then add and push
git add .
git push
链接地址: http://www.djcxy.com/p/23412.html
上一篇: 如何忽略已提交的文件到Git的任何更改