Skip to content

Instantly share code, notes, and snippets.

@aldenw
Last active May 23, 2023 19:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aldenw/a64c01ff9f18c660f114d2611fa6bb06 to your computer and use it in GitHub Desktop.
Save aldenw/a64c01ff9f18c660f114d2611fa6bb06 to your computer and use it in GitHub Desktop.
Delete already merged remote branches
git branch -r --merged | egrep -v '(master|main|release|development)' | sed 's/origin\///' | xargs -n 1 git push --delete origin
@aldenw
Copy link
Author

aldenw commented May 11, 2023

From the release/main branch run this to delete all merged remote branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment