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

21👍

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 ~
👤Toshi

2👍

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.

👤KayO

Leave a comment