# File lib/capistrano/recipes/deploy/scm/git.rb, line 168
        def sync(revision, destination)
          git     = command
          remote  = origin

          execute = []
          execute << "cd #{destination}"

          # Use git-config to setup a remote tracking branches. Could use
          # git-remote but it complains when a remote of the same name already
          # exists, git-config will just silenty overwrite the setting every
          # time. This could cause wierd-ness in the remote cache if the url
          # changes between calls, but as long as the repositories are all
          # based from each other it should still work fine.
          if remote != 'origin'
            execute << "#{git} config remote.#{remote}.url #{configuration[:repository]}"
            execute << "#{git} config remote.#{remote}.fetch +refs/heads/*:refs/remotes/#{remote}/*"
          end

          # since we're in a local branch already, just reset to specified revision rather than merge
          execute << "#{git} fetch --tags #{remote} && #{git} reset --hard #{revision}"

          if configuration[:git_enable_submodules]
            execute << "#{git} submodule init"
            execute << "#{git} submodule update"
          end

          execute.join(" && ")
        end