vendor/cache/ruby/2.3.0/gems/capistrano-2.9.0/lib/capistrano/recipes/deploy/scm/git.rb
# Performs a clone on the remote machine, then checkout on the branch
# you want to deploy.
Performs a clone on the remote machine, then checkout on the branch
you want to deploy.
Performs a clone on the remote machine then checkout on the branch you want to deploy .
def checkout(revision, destination)
          git    = command
          remote = origin
          args = []
          args << "-o #{remote}" unless remote == 'origin'
          if depth = variable(:git_shallow_clone)
            args << "--depth #{depth}"
          end
          execute = []
          execute << "#{git} clone #{verbose} #{args.join(' ')} #{variable(:repository)} #{destination}"
          execute << "cd #{destination} && #{git} checkout #{verbose} -b deploy #{revision}"
          if variable(:git_enable_submodules)
            execute << "#{git} submodule #{verbose} init"
            execute << "#{git} submodule #{verbose} sync"
            if false == variable(:git_submodules_recursive)
              execute << "#{git} submodule #{verbose} update --init"
            else
              execute << %Q(export GIT_RECURSIVE=$([ ! "`#{git} --version`" \\< "git version 1.6.5" ] && echo --recursive))
              execute << "#{git} submodule #{verbose} update --init $GIT_RECURSIVE"
            end
          end
          execute.compact.join(" && ").gsub(/\s+/, ' ')
        end
def checkout ( revision , destination ) git = command remote = origin args = [ ] args << "-o #{remote}" unless remote == 'origin' if depth = variable ( :git_shallow_clone ) args << "--depth #{depth}" end execute = [ ] execute << "#{git} clone #{verbose} #{args.join(' ')} #{variable(:repository)} #{destination}" execute << "cd #{destination} && #{git} checkout #{verbose} -b deploy #{revision}" if variable ( :git_enable_submodules ) execute << "#{git} submodule #{verbose} init" execute << "#{git} submodule #{verbose} sync" if false == variable ( :git_submodules_recursive ) execute << "#{git} submodule #{verbose} update --init" else execute << %Q(export GIT_RECURSIVE=$([ ! "`#{git} --version`" \\< "git version 1.6.5" ] && echo --recursive)) execute << "#{git} submodule #{verbose} update --init $GIT_RECURSIVE" end end execute . compact . join ( " && " ) . gsub ( / \s + / , ' ' ) end
Performs a clone on the remote machine, then checkout on the branch
you want to deploy.
Performs a clone on the remote machine then checkout on the branch you want to deploy .
# checkout into a local branch rather than a detached HEAD
revision
<not_specific>
destination
<not_specific>