Monthly Archives: July 2013

Git mass delete by find

Oops. You transferred repositories. Or, by accident included all your compile and tmp files into your commit. There’s a cool solution. Of course, substitute “*.pyc” with whatever reg ex you need…

Found this on http://yuji.wordpress.com/2010/10/29/git-remove-all-pyc/

First, git rm them
find . -name "*.pyc" -exec git rm -f {} \;

Then, add a .gitignore file in the root of your repo and enter a line:
*.pyc

to prevent them from being added automagically in the future without an -f