# File lib/chef/provider/git.rb, line 114
      def sync
        revision = revision_sha
        sync_command = []

        # 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 @new_resource.remote != 'origin'
          Chef::Log.info  "Configuring remote tracking branches for repository #{@new_resource.repository} "+
                          "at remote #{@new_resource.remote}"
          sync_command << "#{git} config remote.#{@new_resource.remote}.url #{@new_resource.repository}"
          sync_command << "#{git} config remote.#{@new_resource.remote}.fetch +refs/heads/*:refs/remotes/#{@new_resource.remote}/*"
        end

        # since we're in a local branch already, just reset to specified revision rather than merge
        sync_command << "#{git} fetch #{@new_resource.remote} && #{git} fetch #{@new_resource.remote} --tags && #{git} reset --hard #{revision}"
        Chef::Log.info "Fetching updates from #{new_resource.remote} and resetting to revison #{revision}"
        run_command(run_options(:command => sync_command.join(" && "), :cwd => @new_resource.destination))
      end