⚠️ This article was posted over 2 years ago. The information might be outdated. ⚠️
Table of Contents
Commit all your changes
Before proceeding, make sure all your changes are committed, including your .gitignore
file.
Remove everything from the repository
To clear your repo, use:
$ git rm -r --cached .
You can untrack a specific file with:
$ git rm -r --cached foo.txt
Re-add everything
$ git add .
Commit
$ git commit -m ".gitignore fix"