class Dolphin::Git

Git related commands

Public Instance Methods

checkout(tag=nil) click to toggle source
# File lib/dolphin/git.rb, line 24
def checkout(tag=nil)
  if tag
    command = "git checkout #{tag}"
  else
    command = "git checkout `cat #{@head_file}`"
  end
  menu = [
    "
      cd #{@deploy_dir}
      #{command}
    ",
  ]

  execute menu
end
update() click to toggle source
# File lib/dolphin/git.rb, line 5
def update
  menu = [
    "
      cd #{@deploy_dir}
      # Save git head info
      git rev-parse HEAD > #{@head_file}
      git fetch
      git stash
      git checkout #{@branch}
      git rebase origin/#{@branch}
      git stash apply
      git stash clear
    ",
  ]

  execute menu
end