Skip to content

Instantly share code, notes, and snippets.

@mreinsch
Forked from malclocke/gist:943565
Last active October 23, 2015 14:18
Show Gist options
  • Save mreinsch/0143cf9c9a91ebfacfeb to your computer and use it in GitHub Desktop.
Save mreinsch/0143cf9c9a91ebfacfeb to your computer and use it in GitHub Desktop.
delete all remote branches that have already been merged into master
$ git branch -r --merged master |
awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' |
xargs git push origin --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment