Reputation: 5800
I have directory tree like this:
__pycache__
systems
__pycache__
...
components
__pycache__
...
...
I tried the following .gitignore
s to ignore all __pycache__
directories. However, they are not working - only the first one is ignored.
**/__pycache__/
and __pycache__/
How do I ignore all of them?
Upvotes: 4
Views: 1959
Reputation: 1328712
Because I am on Windows, do I have to use a backslash instead
No, you do not need to use a backslash.
This is enough to ignore all _pycache__/
folders:
__pycache__/
Make sure your .gitignore
is at the root folder of your repository.
Check that this has an empty output:
git check-ignore -v -- components/_pycache__/aFile
To be sure, try this and then check again:
git rm --cached -r components/_pycache__/
Upvotes: 4