Last active
November 27, 2023 13:31
-
-
Save cboudereau/466c7fac511c8cf5fc9455cf2e7c3913 to your computer and use it in GitHub Desktop.
git prune except main
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/bash | |
# dry run | |
g remote prune -n origin | |
# remove old local remote | |
g remote prune origin | |
# remove old local branches except main | |
g br | grep -ve main | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment