Reputation: 113
The file in my application settings.cpython-36.pyc
is not being ignored even though I have added it to the .gitignore
file.
My gitignore code:
*.log
*.pot
*.pyc
.idea
LearnDjango/__pycache__/
venv/
/LearnDjango/settings.py
LearnDjango/__pycache__/settings.cpython-36.pyc
Gitkraken view, you can see it still picks it up
This line LearnDjango/__pycache__/
in the gitignore file ignores the other .cpython-36.pyc
files but not settings.cpython-36.pyc
View of __pycache__
folder, the 1st and 3rd files are ignored but not the 2nd
P.S I am new to Django and git.
Upvotes: 11
Views: 9966
Reputation: 916
I was facing the same problem.
*.log
*.pot
*.pyc
*/*/*/__pycache__/
*/*/__pycache__/
*/__pycache__/
git rm -rf --cached .
git add .
I hope that this can help you.
Upvotes: 24
Reputation: 114
I recommend you use this in your project.django project sample .gitignore file
Upvotes: 0
Reputation: 572
add these to your gitignore and try it will work
*.pyc
*/*/*/__pycache__/
*/*/__pycache__/
*/__pycache__/
Upvotes: 0