Last active
June 9, 2021 18:37
-
-
Save sganous/ccfcd475e529f3c3b90ab6c4fd685a0c to your computer and use it in GitHub Desktop.
Local git branch cleanup
This file contains 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 --merged | grep -v "master" >/tmp/merged-branches && vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick add to alias:
git config --global alias.purge '!git branch --merged | grep -v "master" >/tmp/merged-branches && vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches'