Delete old git branches.

8/6/2019
· 1 min read

To see what will be done :

git remote prune --dry-run origin
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}'

If you're ok with that, and want to delete the branches:

git remote prune origin
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -D

from:

You can find this page with theses search keywords:

/ prune / purge / remove /
Mathieu TUDISCO
Thanks for reading!
I'm Mathieu TUDISCO, a lead developer at Linkvalue .
You can find me anywhere with @mathieutu.
As a start you can follow me on Twitter or want to find out more about me or the blog.