Last active
January 27, 2016 19:05
-
-
Save toothrot/78dbb7d3336c62b8cf0b to your computer and use it in GitHub Desktop.
Clean up branches that have been merged into master
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/sh | |
set -e | |
if test -d .git | |
then | |
git fetch | |
git checkout master | |
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d | |
git remote prune origin | |
git checkout - | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment