Last active
August 29, 2015 14:07
-
-
Save melkorm/84c9279b795f1ffe96d8 to your computer and use it in GitHub Desktop.
Remove all merged remote branches except dev and master
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
#!/usr/bin/env bash | |
branches=`git branch -r --merged | grep -v 'dev\|master' | sed 's/origin\///g'` | |
for i in $branches ; do | |
echo "Delete branch $i? (y/N)" | |
read delete | |
if [ $delete == 'y' ]; then | |
echo `git push origin :$i` | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment