Created
August 19, 2016 06:00
-
-
Save nzroller/d325a87b88f03601ff55c5b19ffe1490 to your computer and use it in GitHub Desktop.
Github squash-merge PR local cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment