Last Updated: February 25, 2016
·
965
· douglas-c-thomas

Remove .pyc Files Automatically

On a couple of occasions, I have ended up with stale .pyc files when switching back and forth between several git branches. After the first time, I recognized it when it happened, but this little post-update script can help make sure you never run into this issue.

#!/bin/bash
find $(git rev-parse --show-cdup) -name "*.pyc" -delete

http://blog.daniel-watkins.co.uk/2013/01/git-tip-remove-pyc-files-automatically.html