Created
July 22, 2016 09:55
-
-
Save KacperPucek/80e3b65b554133a46808cde176d4d576 to your computer and use it in GitHub Desktop.
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
$ 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
Oftentimes you want to remove only merged branches in a more-safe way, i.e. omitting
-D
flag and replacing it with-d
.What I find working best is
git branch --merged | grep -v '\*' | grep -v 'master' | xargs -n 1 git branch -d