Skip to content

Instantly share code, notes, and snippets.

@bfritz
Forked from schacon/gist:942899
Created April 27, 2011 00:35
Show Gist options
  • Save bfritz/943493 to your computer and use it in GitHub Desktop.
Save bfritz/943493 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'[ \t/]+' '{ if (NF == 3 && $2 = "origin" && $3 != "master" ) print $3}' \
| xargs git push origin --delete
@bfritz
Copy link
Author

bfritz commented Apr 27, 2011

Doesn't handle the embedded slash problem though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment