Skip to content

Instantly share code, notes, and snippets.

@myw
Forked from schacon/gist:942899
Created April 26, 2011 20:02
Show Gist options
  • Save myw/943003 to your computer and use it in GitHub Desktop.
Save myw/943003 to your computer and use it in GitHub Desktop.
delete all remote branches that have already been merged into master
#!/bin/sh
git branch -r --merged | \
awk -F/ '!/>|master/&&/origin/{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