Gush\Helper\GitHelper::syncWithRemote PHP Method

syncWithRemote() public method

public syncWithRemote ( $remote, $branchName = null )
    public function syncWithRemote($remote, $branchName = null)
    {
        $this->guardWorkingTreeReady();
        $activeBranchName = $this->getActiveBranchName($branchName);
        $this->stashBranchName();
        if (null === $branchName) {
            $branchName = $activeBranchName;
        }
        $this->remoteUpdate($remote);
        if ($activeBranchName !== $branchName) {
            $this->checkout($branchName);
        }
        $this->reset('HEAD~1', 'hard');
        $this->pullRemote($remote, $branchName, true);
        if ($activeBranchName !== $branchName) {
            $this->checkout($activeBranchName);
        }
    }