Skip to content

Instantly share code, notes, and snippets.

@lancerushing
Forked from schacon/gist:942899
Created November 12, 2012 23:43
Show Gist options
  • Save lancerushing/4062845 to your computer and use it in GitHub Desktop.
Save lancerushing/4062845 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 -v '>' |
grep -v master |
cut -d "/" -f 2- |
xargs git push origin --delete
@lancerushing
Copy link
Author

Using cut with '-f 2-' allows /'s in the branch name. Like git flow's 'feature/{name}' branches.

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