[Django]-Does not ignore db.sqlite3 file,even i specified in .gitignore in django project

8๐Ÿ‘

โœ…

I had the same issue but found out that my problem was that I had already tracked and committed the db.sqlite3 file in previous commit, which made it impossible for git to ignore when I later added it to the .gitignore.

I think this is not your case but maybe it can give you some hints towards a solution.

To untrack the file without deleting the local file I used:

git rm -r --cached db.sqlite3

After this, the .gitignore is doing the job as intended.

๐Ÿ‘คvictorcalabuig

0๐Ÿ‘

Remove the *s.

If you specifically want to ignore the pycache and db.sqlite3 files,
just add

__pycache__/
db.sqlite3

to your .gitignore file. Alternatively search for django .gitignore files and sample from there.

If you want to know in depth on the gitignore file check out https://git-scm.com/docs/gitignore

๐Ÿ‘คapplecider

Leave a comment