Our team at KrakenFlex.com uses GitHub’s squash-merge then auto-delete branch functionality a lot.
It’s awesome at a lot of things, but it does cause a bit of a challenge because commands like git fetch --prune
don’t work, as the branch wasn’t merged in but was deleted.
The best snippet I’ve found that does this so far:
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -Df
Leave a Reply