Created
July 27, 2019 13:40
-
-
Save darkmavis1980/e9c4607be6e4cdbe3d0aa40a06c34b2a to your computer and use it in GitHub Desktop.
Delete all git branches matching regex
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
git branch | grep "<pattern>" | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example:
git branch | grep "bugfix" | xargs git branch -D
Deletes all the branches containing the word 'bugfix'