Skip to content

Instantly share code, notes, and snippets.

@stuaxo
Last active November 29, 2017 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuaxo/8b836b90ea46a27c228f8ded4d42d162 to your computer and use it in GitHub Desktop.
Save stuaxo/8b836b90ea46a27c228f8ded4d42d162 to your computer and use it in GitHub Desktop.
Delete merged branches
# Make sure the list to ignore after -v is correct
$ git branch -r --merged develop | sed 's/ origin\///' | grep -v 'master\|staging\|develop' | xargs git push origin --delete
# See also
https://makandracards.com/makandra/621-git-delete-a-branch-local-or-remote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment