from http://d.pr/i/7Px4 to http://d.pr/i/5Vl2
Save as git-make
, chmod +x, make it available in PATH, then
$ git make staging of dev feature/foo feature/bar
#!/usr/bin/env ruby | |
def sh(cmd) | |
puts "[sh] #{cmd}" | |
raise "git error" unless system(cmd) | |
end | |
if ARGV.size < 3 || ARGV[1] != "of" | |
puts "Example usage: git make staging of dev feature/foo feature/bar" | |
else | |
dpl = ARGV[0] | |
base = ARGV[2] | |
rest = ARGV.drop(3) | |
print "Warning!! This will delete branch #{dpl} ! (Hit enter to continue or Ctrl-C to cancel)" | |
STDIN.gets | |
sh "git checkout #{base}" | |
sh "git branch -D #{dpl}" | |
sh "git checkout -b #{dpl}" | |
rest.each {|r| sh "git merge #{r}" } | |
sh "git push -f origin #{dpl}" | |
end |
from http://d.pr/i/7Px4 to http://d.pr/i/5Vl2
Save as git-make
, chmod +x, make it available in PATH, then
$ git make staging of dev feature/foo feature/bar