user3757897
user3757897

Reputation: 326

.gitignore is still not ignoring files despite removal

I know there are many, many posts on this topic. I've tried all of the answers I can find and none of them seem to be addressing my problem.

I started a git project where unfortunately .pyc files in __pycache__ directories were initially being tracked. I realised the problem and then put *.pyc and __pycache__ in .gitignore, but of course they were still being tracked.

I then:

I'm still getting .pyc files showing changes:

git status
...
modified:   buildSite/builder/templatetags/__pycache__/class_tag.cpython-36.pyc

Very grateful for any suggestions!

Upvotes: 3

Views: 1690

Answers (1)

VonC
VonC

Reputation: 1323353

Make sure:

  • there is no crlf in your .gitignore file
  • there is no nested git repo (.git/ subolder) in any parent folder of your files to be ignored
  • there is a trailing / when ignoring a folder: __pycache__/, not __pycache__.

Upvotes: 4

Related Questions