Created
September 13, 2016 07:38
-
-
Save fajarmf/426f2d1b442cea27d26cea5a6a3efa04 to your computer and use it in GitHub Desktop.
Cleanup local branch that doesn't have remote upstream. Most of the time due to PR squash
This file contains 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
git fetch --prune; diff --new-line-format="" --unchanged-line-format="" <(git branch | grep -v master | grep -v "*" | sort) <(git branch -r | awk '{print $1}' | awk '{sub("origin/", ""); print $0}' | sort) | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment