Skip to content

Instantly share code, notes, and snippets.

@catsby
Forked from schacon/gist:942899
Created April 26, 2011 20:16
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catsby/943028 to your computer and use it in GitHub Desktop.
Save catsby/943028 to your computer and use it in GitHub Desktop.
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{sub(/origin\//,"");print}' |
xargs git push origin --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment