[Solved]-I cannot ignore pycache and db.sqlite on Django even though it refers them at .gitignore


As follows, I’ve solved the problem.

git rm -r --cached .   # will delete whole git history, use with caution
git add .
git commit -m
git push ~


As an alternative to git rm -r --cached . in the @lalala’s answer, you can target the files you actually want to delete from the cache using git rm --cached <filename>.
This is generally more desirable since it leaves the other files untouched. You may use metacharacters like *.sqlite in place of <filename> to target even more files.


Leave a comment