12 Jan 20201 min read

Untrack files already added to the repository

There always comes a time when you are in a hurry or simply did not know that that specific file or folder should be ignored. Then you modify the .gitignore file and that one or more files are still there... what you should do now? Thankfully, there is an easy way to fix that. But, before you execute those steps commit your changes as you might lose them!

git rm -r --cached .
git add .

And now any file that should be ignored will be deleted and you can enjoy your clean and shiny repository.