Created
April 4, 2019 20:30
-
-
Save seleb/5b0083122c7d1535dd8ca4b196e27e60 to your computer and use it in GitHub Desktop.
delete local git branches not present on remote; from https://stackoverflow.com/questions/13064613/how-to-prune-local-tracking-branches-that-do-not-exist-on-remote-anymore/17029610
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
| git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment