Skip to content

Instantly share code, notes, and snippets.

@nmcolome
Last active July 30, 2020 03:13
Show Gist options
  • Save nmcolome/0fb9fe3dc4dc69b0cfd11f8f42e9b3e8 to your computer and use it in GitHub Desktop.
Save nmcolome/0fb9fe3dc4dc69b0cfd11f8f42e9b3e8 to your computer and use it in GitHub Desktop.
Make Git 'forget' about a file that was tracked but now is ignored

When you want to be specific:

To remove a file

git rm --cached <file>

To remove a directory

git rm -r --cached <folder>

Otherwise:

git rm -r --cached .

Finally:

git add .
git commit -am "Remove ignored files"
@nmcolome
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment