Skip to content

Instantly share code, notes, and snippets.

Created July 29, 2013 19:21
Show Gist options
  • Save anonymous/6106972 to your computer and use it in GitHub Desktop.
Save anonymous/6106972 to your computer and use it in GitHub Desktop.
require 'pry'
results = `git branch -r`.split("\n")
ignored = ['master', 'production', 'new_mobile_nav']
results.map!(&:strip)
results.map! do |branch|
args = branch.split("/")
[args[0], args[1]]
end
results.each do |branch|
unless ignored.include?(branch[1]) or branch[1] =~ /HEAD/
command = "git push #{branch[0]} :#{branch[1]}"
puts `#{command}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment