Last active
January 22, 2019 16:38
-
-
Save naveed-ahmad/43151ca612b90b3007862e4e7f3553ea to your computer and use it in GitHub Desktop.
cleanup local git branches
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
# Remove all branches except master and develop | |
git branch | grep -v "master\|develop" | xargs git branch -D | |
# Even better, create a git alias | |
git config --global alias.clean-branches "!git branch | grep -v "master\|develop" | xargs git branch -D" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment