Sha256: 201c1aca8faf38bb3fdde9e02a47dda62dbb9c28f1abc19b2ba3267b16bc9331

Contents?: true

Size: 908 Bytes

Versions: 15

Compression:

Stored size: 908 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!"
  puts "Usage: merge TARGET_BRANCH"
  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

15 entries across 15 versions & 1 rubygems

Version Path
pivotoolz-2.4.2 exe/merge
pivotoolz-2.4.1 exe/merge
pivotoolz-2.4.0 exe/merge
pivotoolz-2.3.0 exe/merge
pivotoolz-2.2.0 exe/merge
pivotoolz-2.1.0 exe/merge
pivotoolz-2.0.0 exe/merge
pivotoolz-1.3.0 exe/merge
pivotoolz-1.2.2 exe/merge
pivotoolz-1.2.0 exe/merge
pivotoolz-1.1.1 exe/merge
pivotoolz-1.1.0 exe/merge
pivotoolz-1.0.0 exe/merge
pivotoolz-0.2.0 exe/merge
pivotoolz-0.1.3 exe/merge