-
-
Save fabricionaweb/2e7f411c1cc62eb765c3ea15461520ab to your computer and use it in GitHub Desktop.
Delete local branches (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
# Delete branches that are already merged (but master/development/stage) | |
git branch --merged | egrep -v "(^\*|master|development|stage)" | xargs git branch -d | |
# Delete all local branches (but master/development/stage) | |
git branch | egrep -v "(^\*|master|development|stage)" | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment