Last active
April 7, 2021 13:20
-
-
Save matipojo/30e485db59d1952c082925297c9bbd10 to your computer and use it in GitHub Desktop.
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
| # Local | |
| ## Dry run, review what will be deleted: | |
| git branch --merged | egrep -v "(^\*|master|develop)" | |
| ## Delete! | |
| git branch --merged | egrep -v "(^\*|master|develop)" | xargs git branch -d | |
| # Remote (origin) | |
| ## Dry run, review what will be deleted: | |
| git branch -r -l 'origin*' --merged | egrep -v "(^\*|master|develop)" | sed 's/origin\///' | | |
| ## Delete! | |
| git branch -r -l 'origin*' --merged | egrep -v "(^\*|master|develop)" | sed 's/origin\///' | xargs -n 1 git push --delete origin | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment