Skip to content

Instantly share code, notes, and snippets.

@erkobridee
Created February 3, 2022 14:00
Show Gist options
  • Save erkobridee/dcce67728a19aa5cbe02cd2b1453aa0b to your computer and use it in GitHub Desktop.
Save erkobridee/dcce67728a19aa5cbe02cd2b1453aa0b to your computer and use it in GitHub Desktop.
besides the defined list on the regex remove all other branches which were merged
git branch --merged | egrep -v "(^\*|master|main|staging|develop)" | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment