Created
March 2, 2020 17:28
-
-
Save avtarnanrey/fbe708f2e733152c30b1eebb363488dd to your computer and use it in GitHub Desktop.
Clean local branches merged or obsolete
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
// To delete all merged branches except master and dev | |
git branch --merged | grep -v '\*\|master\|dev' | xargs -n 1 git branch -d | |
// To delete all branches except master and dev: | |
git branch | grep -v '\*\|master\|dev' | xargs -n 1 git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment