git delete local merged branches code example
Example 1: git delete merged branches
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
Example 2: delete all feature branches
git branch --merged | grep -v '^* master$' | grep -v '^ master$' | xargs git branch -d