Prune all local branches not on remote

Git

List out all local branches and attempt to delete any that aren't present on the remote and aren't unmerged.

Code

git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d