View clean_merged_branches.sh
#!/usr/bin/env sh
git checkout master
for BRANCH in $(git branch --merged | grep -v "*")
do
git branch -d $BRANCH
done
git remote prune origin