1

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

Community
  • 1
  • 1
agent.smith
  • 9,134
  • 9
  • 37
  • 49

2 Answers2

3

To first remove the cached contents

git rm -r --cached

then add and push

git add .

git push
David K
  • 692
  • 10
  • 23
tr33hous
  • 1,622
  • 1
  • 15
  • 26
2

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

Leon
  • 988
  • 7
  • 20