Skip to content

Instantly share code, notes, and snippets.

@oferrigni
Created February 10, 2012 17:41
Show Gist options
  • Save oferrigni/1791175 to your computer and use it in GitHub Desktop.
Save oferrigni/1791175 to your computer and use it in GitHub Desktop.
Remove all commits associated with a directory structure for every remote branch assume remote named origin
for j in `git br -r`;do git co ${j:7};for i in `ls -d <name-prefix>*`;do echo git filter-branch -f --index-filter "'"git rm -rf --cached --ignore-unmatch $i"'" -- `git log --pretty=format:"%h" -n1 $i`^.. > act.sh;chmod a+x ./act.sh; ./act.sh;done;done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment