clean local branches git code example
Example 1: clean local branches git
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
Example 2: git clean local branches
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d