Created
June 9, 2011 21:12
-
-
Save dblock/1017765 to your computer and use it in GitHub Desktop.
Delete merged git branches.
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 | xargs git branch -d | |
git branch -r --merged | awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | xargs git push origin --delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or you could use git-delete-merged-branches. If can delete both local and remote branches, detects squash merges, and more.