Last active
March 24, 2016 09:24
-
-
Save thinkyhead/ff72e9cef8c908f2a972 to your computer and use it in GitHub Desktop.
Git Prune Everything - Prune all merged branches and all "gone" branches
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 | |
echo "Pruning Merged Branches..." | |
git branch --merged | egrep -v "^\*|master|development" | xargs -n 1 git branch -d | |
echo | |
echo "Pruning Gone Branches..." | |
git branch -vv | grep ': gone]' | gawk '{print $1}' | xargs -n 1 git branch -D | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment