Skip to content

Instantly share code, notes, and snippets.

@jlyonsmith
Forked from schacon/gist:942899
Last active April 21, 2016 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlyonsmith/bc3fee81c5f0499bd405d2c59bc591f8 to your computer and use it in GitHub Desktop.
Save jlyonsmith/bc3fee81c5f0499bd405d2c59bc591f8 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 | ruby -e 'ARGF.each { |line| a = line.match(/(?:[^\/]*)\/(.*)/).captures; puts a }' | xargs git push origin --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment