Remove all .pyc files from a git repository
When working on Python project you may sometimes forget to .gitignore your
*.pyc files and end up having them tracked by the repo.
To fix this you need use git rm:
find . -name "*.pyc" -exec git rm -f {} \;
Then, add a line:
*.pyc
to the .gitignore file in the repository root to have them permanently
ignored.
Credit goes to Yuji.