Last active
December 20, 2015 10:39
-
-
Save radfahrer/6117536 to your computer and use it in GitHub Desktop.
cleanup merged branches
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
#!/usr/bin/env sh | |
git checkout master | |
for BRANCH in $(git branch --merged | grep -v "*") | |
do | |
git branch -d $BRANCH | |
done | |
git remote prune origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Made a minor change to add in shell check and the right
git branch
command