Method: Gold#rebase

Defined in:
lib/gold.rb

#rebaseObject



86
87
88
89
90
91
92
93
94
95
# File 'lib/gold.rb', line 86

def rebase
  branch = current_branch
  return error("Could not find current branch.") unless branch
  return error("You cannot rebase the #{gold_branch} branch !") if branch == gold_branch
  return error("You cannot rebase the master branch !") if branch == 'master'
  return error("Could not checkout #{gold_branch}.") unless system("git checkout #{gold_branch}")
  return error("Could not pull #{gold_branch}.") unless system("git pull")
  return error("Could not checkout #{branch}.") unless system("git checkout #{branch}")
  return error("Could not rebase --interactive #{gold_branch}.") unless system("git rebase --interactive #{gold_branch}")
end