Last active
January 26, 2022 16:08
Revisions
-
smudge revised this gist
Jan 26, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ # This is REALLY UNSAFE. Don't do this on a shared repo! # Again: DO NOT DO THIS unless you're really, really sure. git branch -r | grep -e "origin" | grep -v "origin/main" | awk '{sub(/origin\//,"");print}'| sed 's/^[ *]*//' | sed 's/^/git push origin :/' | bash ### BONUS: Delete all remote tags # Same warning applies! -
smudge revised this gist
Apr 25, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ # This is REALLY UNSAFE. Don't do this on a shared repo! # Again: DO NOT DO THIS unless you're really, really sure. git branch -r | grep -e "origin" | grep -v "origin/master" | awk '{sub(/origin\//,"");print}'| sed 's/^[ *]*//' | sed 's/^/git push origin :/' | bash ### BONUS: Delete all remote tags # Same warning applies! -
smudge revised this gist
Nov 1, 2017 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,5 +9,9 @@ git branch -r | grep -v "origin/master" | awk '{sub(/origin\//,"");print}'| sed ### BONUS: Delete all remote tags # Same warning applies! # Deletes 1000 at a time git push origin --delete $(git ls-remote --tags origin | grep -v "{}$" | awk '{sub(/.+refs\/tags\//,"");print}' | head -n 1000) # Delete all local tags: git tag -l | xargs git tag -d -
smudge created this gist
Nov 1, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #### Delete all remote git branches # Primary purpose: When you fork a repo and want a clean slate for your fork. #### WARNING # This is REALLY UNSAFE. Don't do this on a shared repo! # Again: DO NOT DO THIS unless you're really, really sure. git branch -r | grep -v "origin/master" | awk '{sub(/origin\//,"");print}'| sed 's/^[ *]*//' | sed 's/^/git push origin :/' | bash ### BONUS: Delete all remote tags # Same warning applies! git tag -l | xargs -n 1 git push --delete origin