how to delete merged branches in git

How to delete merged branches in git

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

You can also create a git alias:

git config --global alias.dm \
'!sh -c "git branch --merged | grep -v \* | grep -v master | xargs git branch -d"'

Life can be much broader once you discover one simple fact: everything around that you call life, was made up by people no smarter than you.

-- Jobs