Skip to content

Instantly share code, notes, and snippets.

@janhenrik
Forked from malclocke/gist:943565
Created May 17, 2012 20:39
Show Gist options
  • Save janhenrik/2721465 to your computer and use it in GitHub Desktop.
Save janhenrik/2721465 to your computer and use it in GitHub Desktop.
delete all remote branches that have already been merged into master
$ git branch -r --merged |
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