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
$ git branch -a
# *master
# b1
# remote/origin/master
# remote/origin/b1
$ git push origin --delete b1
# [...]
# - [deleted] b1
$ git branch -r | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | xargs git branch -d
$ git branch -a
# *master
# b1
# remote/origin/master
# remote/origin/b1
$ git push origin --delete b1
# [...]
# - [deleted] b1