Created
August 19, 2013 18:23
-
-
Save alloy-d/6272371 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It is acknowledged that all perl one-liners here are both inelegant | |
# and probably great targets for replacement with sed. | |
# Get a list of fully merged branches: | |
git branch --merged | perl -pe '$_ =~ s/..//' > branches | |
# edit branches to exclude branches that shouldn't be deleted (example: master) | |
# Delete branches locally: | |
xargs git branch -d < branches | |
# Delete remote branches: | |
perl -pe '$_ =~ s/^/:/' < branches | xargs git push origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment