Created
February 6, 2018 15:50
-
-
Save leongaban/8e0114037b4ece75358e4041cb5bd45a to your computer and use it in GitHub Desktop.
Prune local Git 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
# Replace REL_BRANCH with the appropriate name | |
git fetch --all --prune && git branch --merged | egrep -v "(^\*|REL_BRANCH|master)" | xargs -I % sh -c 'git branch -d %1; git push origin :%1;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment