Git tip: Have a lot of old branches on your machine
Git tip: Have a lot of old branches on your machine? Here's a Bash script that removes local branches that are no longer remote:
git fetch -p && for branch in `git branch -vv --no-color | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done