Last active
May 2, 2018 14:44
-
-
Save themsaid/92dc313ffda506f0f0f3f295ed66a64b to your computer and use it in GitHub Desktop.
Delete all branches except
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
// Delete all except multiple | |
git branch | grep -v "master\|dev" | xargs git branch -D | |
// Delete all except 1 | |
git branch | grep -v "master" | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yup, but
-D
should be used carefully though as it'll force delete unmerged branch @themsaid :)