Created
January 27, 2022 08:29
-
-
Save perrmadiafrrian/0fbd08410e8ba831dc00de7efc9b042a to your computer and use it in GitHub Desktop.
Removing all local branch except `master` or `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/sh | |
| git for-each-ref --format '%(refname:short)' refs/heads | grep -v "master\|main" | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment