Skip to content

Instantly share code, notes, and snippets.

@shishi
Forked from fujimura/delete_remote_branch.sh
Created June 25, 2012 12:25
Show Gist options
  • Save shishi/2988288 to your computer and use it in GitHub Desktop.
Save shishi/2988288 to your computer and use it in GitHub Desktop.
Delete remote brranches except master
git branch -a | grep origin | cut -d / -f 3 | grep -v master | \
ruby -e "STDIN.to_a.tap(&:shift).map(&:chomp).each {|s| p %|git push origin #{s}| }"
# replace `p` with `system` to run actual command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment