Skip to content

Instantly share code, notes, and snippets.

@arpitr
Created December 31, 2020 05:19
Show Gist options
  • Save arpitr/ac637bf2d530fbb77b9b72772f05d03c to your computer and use it in GitHub Desktop.
Save arpitr/ac637bf2d530fbb77b9b72772f05d03c to your computer and use it in GitHub Desktop.
Delete merged branches from remote
// will skip deleting branches master|dev|stage
// replace origin with remote name
git branch -r --merged| egrep -v "(^\*|master|dev|stage)" | sed 's/origin\///' | xargs -n 1 git push --delete origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment