Last active
August 23, 2018 02:11
-
-
Save nickcheng/478f45c8c76570807674938c1ce5f104 to your computer and use it in GitHub Desktop.
[Remove merged branches locally] except current branch, master branch and develop branch #git
This file contains hidden or 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
# In CLI | |
git branch --merged | grep -v "\*" | grep -v "master" | grep -v "develop" | grep -v "staging" | xargs -n 1 git branch -d | |
# As a shell alias | |
alias gbpurge='git branch --merged | grep -v "\*" | grep -v "master" | grep -v "develop" | grep -v "staging" | xargs -n 1 git branch -d' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment