Skip to content

Instantly share code, notes, and snippets.

@grimzy
Last active October 24, 2019 14:56
Show Gist options
  • Save grimzy/f413a7b07273db26f8501b59c4740d46 to your computer and use it in GitHub Desktop.
Save grimzy/f413a7b07273db26f8501b59c4740d46 to your computer and use it in GitHub Desktop.
Delete merged branches
git branch -r --merged | grep -v 'master\|develop\|support/1.0.X\|support/1.1.X' | sed 's/origin\///' | xargs -n 1 git push --delete origin
git branch -r --merged | grep -v 'master\|develop\|support/1.0.X\|support/1.1.X' | sed 's/origin\///'
@grimzy
Copy link
Author

grimzy commented Oct 24, 2019

Excluding branches: master, develop, support/1.0.X, support/1.1.X

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