Deleting multiple merged branches

If you have old branches lying around then the chances are, some of them have been merged and can be safely deleted.

Deleting any branches that have been merged into the currently checked out branch then:

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

simple as that.

Sharing is caring Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisEmail this to someoneShare on Reddit