.gitignore is not working
Sometimes I want to ignore a file, I add it to .gitignore
and the file doesn't disappear from my change list. I want to remember the following, since I always end up reading the same answer to this question.
Even if you haven't tracked the files so far, git seems to be able to "know" about them even after you add them to .gitignore
.
NOTE : First commit your current changes, or you will lose them.
Then run the following commands from the top folder of your git repo:
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
Written by eresendez
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#