romainprignon
8/19/2016 - 6:00 AM

Github squash-merge PR local cleanup

Github squash-merge PR local cleanup

#!/bin/sh

# Delete local branches whose upstream has been removed
# (useful for Github squashed and merged branches)
# WARNING: git branch -D will force delete branches!
git branch -vv | grep ' gone' | cut -d' ' -f1-3 | xargs -i git branch -D {}