public function checkout($ref, bool $create = false)
    {
        if ($create && is_null($this->getBranch($ref))) {
            $this->createBranch($ref);
        }
        $this->caller->execute(MainCommand::getInstance($this)->checkout($ref));

        return $this;
    }
public function checkout($ref, bool $create = false)
    {
        if ($create && is_null($this->getBranch($ref))) {
            $this->createBranch($ref);
        }
        $this->caller->execute(MainCommand::getInstance($this)->checkout($ref));

        return $this;
    }
public function checkout ( $ ref , bool $ create = false ) { if ( $ create && is_null ( $ this -> getBranch ( $ ref ) ) ) { $ this -> createBranch ( $ ref ) ; } $ this -> caller -> execute ( MainCommand :: getInstance ( $ this ) -> checkout ( $ ref ) ) ; return $ this ; }
Checkout a branch
This function change the state of the repository on the filesystem

@param string|TreeishInterface $ref    the reference to checkout
@param bool                    $create like -b on the command line

@throws \RuntimeException
@throws \Symfony\Component\Process\Exception\LogicException
@throws InvalidArgumentException
@throws \Symfony\Component\Process\Exception\RuntimeException
@return Repository
Checkout a branch This function change the state of the repository on the filesystem