Last Updated: February 25, 2016
·
754
· shinn

.gitignore not working

I've been facing this issues a few times but not sure how it actually happened (I guess it has something to do with git caching). Anyway here's the solution to clean up the cache.

git rm -r --cached .
git add .

Commit the changes and continue your development journey :)

2 Responses
Add your response

I believe this happens when you try to ignore a file that's already in the repository.

over 1 year ago ·

Correct. By default, .gitignore only ignores new files that haven't been added to the repository.

over 1 year ago ·