Created
November 27, 2025 16:48
-
-
Save nickboldt/ef85af5e6c4f53be5ae1e87347cf13ee to your computer and use it in GitHub Desktop.
remove dead branches
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
| git fetch -a; \ | |
| for branch in $(git branch -a -r | grep -v rhdh-1 | sed -r -e "s|.+origin/||"); do \ | |
| echo $branch; git push origin :${branch}; git branch -D ${branch}; \ | |
| done; \ | |
| for branch in $(git branch -a -r | grep -E -v "origin/rhdh-1.*-rhel-9" | grep rhdh-1 | sed -r -e "s|.+origin/||"); do \ | |
| echo $branch; git push origin :${branch}; git branch -D ${branch}; \ | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment