Skip to content

Instantly share code, notes, and snippets.

@nickboldt
Created November 27, 2025 16:48
Show Gist options
  • Select an option

  • Save nickboldt/ef85af5e6c4f53be5ae1e87347cf13ee to your computer and use it in GitHub Desktop.

Select an option

Save nickboldt/ef85af5e6c4f53be5ae1e87347cf13ee to your computer and use it in GitHub Desktop.
remove dead branches
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