clear git branches locally code example
Example 1: clean local branches git
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
Example 2: git clear local branch list
$ git branch -r --merged | egrep -v "(^\*|master|dev)" | xargs -n 1 git push --delete origin