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"'