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

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:

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