Skip to content

Instantly share code, notes, and snippets.

@philipobenito
Last active June 27, 2017 14:20
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 philipobenito/431a6b61f25f6c6906a17c204bddb307 to your computer and use it in GitHub Desktop.
Save philipobenito/431a6b61f25f6c6906a17c204bddb307 to your computer and use it in GitHub Desktop.
# don't recommend running as one script
# list merged remote branches
git branch -a --merged live | grep -v live
# delete remote merged branches
git branch -a --merged live | grep -v live | xargs -n 1 git push --delete origin
# list merged local branches
git branch --merged live | grep -v live
# delete local merged branched
git branch --merged live | grep -v live | xargs -n 1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment