Created
September 21, 2023 17:12
-
-
Save jbn/a31140700237027fa522aac7012fd3d9 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Fetch updates from remote | |
git fetch | |
# Loop over all branches except main | |
for branch in $(git branch | grep -v "main"); do | |
# Delete the branch | |
git branch -D $branch | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment