Last active
September 12, 2018 20:58
-
-
Save wayne-weibel/c8f246249c79dc4896ef5749327ec8b8 to your computer and use it in GitHub Desktop.
single line bash command to delete remote repos. replace grep regex as necessary (but i would leave 'master' included lol)
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
for branch in `git branch -a | awk -F"/" '{ print $3 }' | grep -Pv '^(master|develop)' | grep -P '^\d'`; do echo $branch; git push origin --delete $branch; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the second
grep
is to eliminate 'HEAD', '->', and 'origin' from the list being processed. the branches i am dealing with all begin with a ticket number