Skip to content

Instantly share code, notes, and snippets.

@dustintheweb
Created May 31, 2013 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustintheweb/5687508 to your computer and use it in GitHub Desktop.
Save dustintheweb/5687508 to your computer and use it in GitHub Desktop.
The fix for when a file is added to .gitignore, but git is still acknowledging its existence...
1) edit the file as needed and back it up somewhere
2) physically delete the file in question (not the backup)
3) edit .gitignore and add path/filename.file
4) remove the file from git using git rm filename.file
5) git add / commit the change
6) copy / paste the backup back into the source folder
7) git status - if done correctly, git will no longer pick up the file
// this issue typically happens when you add a file to .gitignore after the file has already been checked in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment