1

I just updated my .gitignore so I ignore certain files, but when I sync my changes they are still there on github.

Please help me. I have tried many things.

Edit: I looked at those but I don't want to do those because it changes the repo. I want it the gitignore to only work for me

John
  • 21
  • 5
  • 1
    related: http://stackoverflow.com/questions/1274057/making-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore – NightShadeQueen Jul 07 '15 at 18:30
  • could you post your gitignore file? – melli-182 Jul 07 '15 at 18:30
  • possible duplicate of [Ignore files that have already been committed to a Git repository](http://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository) – Sergey Glotov Jul 07 '15 at 18:32

2 Answers2

3

If you just want to untrack a specific file you can use this command:

git rm --cached filename

If you want to untrack a lot of new files that you added to your gitignore you can do this:

git rm -r --cached .
git add .
git commit
adao7000
  • 3,632
  • 2
  • 28
  • 37
2

You have to delete ignored files from the repo with git rm if it is already there.

Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98