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

守: Follow the rules.

破: Break the rules.

離: Make your own rules.