Last Updated: February 25, 2016
·
487
· dinks

Cleanup Merged branches

From this excellent post http://stevenharman.net/git-clean-delete-already-merged-branches

git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d

Or from HEAD

git branch --merged | grep -v "\*" | xargs -n 1 git branch -d

1 Response
Add your response

Good comment there too. Firstly make sure you're checked into master. Or run:
git branch --merged master | grep -v "\master" | xargs -n 1 git branch -d

over 1 year ago ·