Created
February 16, 2015 17:40
-
-
Save e0da/b05c9b049d19a31a5e76 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/sh | |
# Attempt to delete every branch except master and the currently checked out | |
# branch. If the branch isn't merged, it won't delete, and it will be noted on | |
# STDERR. | |
git branch | grep -v '\bmaster\b\|^\*' | while read branch; do | |
git branch -d $branch | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment