git fetch -p && for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do git branch -D $branch; done
git branch -vv | grep ': gone]'| grep -v "*" | awk '{ print $1; }' | xargs -r git branch -D
git branch --merged >/tmp/merged-branches &&
vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches