Created
March 5, 2019 06:42
-
-
Save architjn/9bf6a2b49092006971e5f5364b82b761 to your computer and use it in GitHub Desktop.
git delete local 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
[alias] | |
# Delete all local branches but master and the current one, only if they are fully merged with master. | |
br-delete-useless = "!f(){\ | |
git branch | grep -v "master" | grep -v ^* | xargs git branch -d;\ | |
}; f" | |
# Delete all local branches but master and the current one. | |
br-delete-useless-force = "!f(){\ | |
git branch | grep -v "master" | grep -v ^* | xargs git branch -D;\ | |
}; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment