Last active
March 24, 2016 18:24
-
-
Save nocash/3352c2c5001b68c98b1c 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
#!/bin/bash | |
set -e | |
current=`git symbolic-ref --quiet --short HEAD` | |
exclude="^(master|develop)" | |
git fetch origin | |
git checkout master | |
git reset --hard origin/master | |
git branch --merged origin/master \ | |
| cut -c3- \ | |
| grep -v "$exclude" \ | |
| xargs git branch --delete | |
git checkout "$current" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment