Last active
December 25, 2015 20:39
-
-
Save jkakar/7036756 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
[alias] | |
cleanbranches = !/Users/jkakar/bin/gitcleanbranches.sh |
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/bash | |
set -x | |
git checkout master | |
git pull origin master | |
for branch in `git branch -a --merged | grep -v HEAD | grep -v '*' | tr -d ' ' | cut -d / -f 3 -s | grep -v master` | |
do | |
git branch -d $branch | |
git push origin :refs/heads/$branch | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment