ruang.work

Gitignore File Isn't Working For Some Reason

  • Avatar for Ilham Nuruddin Al Huda
Ilham Nuruddin Al Huda
•

3 min read

The files/folder in your version control will not just delete themselves just because you added them to the .gitignore. They are already in the repository and you have to remove them. You can just do that with this:

Remember to commit everything you’ve changed before you do this!

Terminal window
git rm -rf --cached .
git add .

This removes all files from the repository and adds them back (this time respecting the rules in your .gitignore).

original solution on stackoverflow.com