Git: Delete local branches that no longer exist on origin

Fetch the latest updates from the remote

git fetch --prune

List branches that have been deleted on the remote but still exist locally

git branch -vv | grep ': gone' | awk '{print $1}'

Delete the local branches that no longer exist on the remote

git branch -vv | grep ': gone' | awk '{print $1}' | xargs git branch -D