How can I ignore .pyc files in git?
If I put it in .gitignore it doesn't work. I need them to be untracked and not checked for commits.
if you have committed in the repo, just

go to the folder /__pycache__,
delete all of them (no worries, they are temporary files and generated repeatedly)
have a new commit, such as 'update gitignore'
you are done! .pyc will not appear again.
Ignore .pyc files in git repository