Sha256: 44de51ad234c6a90ae613753fd83695a4dd72702095a579ae7f936fc05a3f1af

Contents?: true

Size: 872 Bytes

Versions: 2

Compression:

Stored size: 872 Bytes

Contents

#!/usr/bin/env ruby

target_branch = ARGV[0]&.strip

if target_branch.nil? || target_branch.empty?
  puts "You must provide a target branch name!"
  exit 1
end

current_branch  = `git rev-parse --abbrev-ref HEAD`.strip
branch_to_merge = current_branch

puts "Running git pull origin #{current_branch} --rebase\n\n"

`git checkout #{target_branch}`
`git pull origin #{target_branch} --rebase`

puts "\nRebasing #{target_branch} into #{branch_to_merge}\n\n"
`git checkout #{branch_to_merge}`
`git rebase #{target_branch}`

puts "\nForce pushing #{branch_to_merge}\n\n"
`git push origin #{branch_to_merge} -f`

puts "\nCompleting the merge of #{branch_to_merge} into #{target_branch}\n\n"
`git checkout #{target_branch}`
`git merge #{branch_to_merge} --no-ff --no-edit`

puts "\nMerge complete, you must run git push origin #{target_branch} manually to complete the merge\n"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pivotoolz-0.1.2 exe/merge
pivotoolz-0.1.1 exe/merge