public function checkOutNew($name, $parent = null, $upstream = null, $dir = null, $mustRun = false)
    {
        $args = ['checkout', '-b', $name];
        if ($parent !== null) {
            $args[] = $parent;
        } elseif ($upstream !== null) {
            $args[] = '--track';
            $args[] = $upstream;
        }

        return (bool) $this->execute($args, $dir, $mustRun, false);
    }
public function checkOutNew($name, $parent = null, $upstream = null, $dir = null, $mustRun = false)
    {
        $args = ['checkout', '-b', $name];
        if ($parent !== null) {
            $args[] = $parent;
        } elseif ($upstream !== null) {
            $args[] = '--track';
            $args[] = $upstream;
        }

        return (bool) $this->execute($args, $dir, $mustRun, false);
    }
public function checkOutNew ( $ name , $ parent = null , $ upstream = null , $ dir = null , $ mustRun = false ) { $ args = [ 'checkout' , '-b' , $ name ] ; if ( $ parent !== null ) { $ args [ ] = $ parent ; } elseif ( $ upstream !== null ) { $ args [ ] = '--track' ; $ args [ ] = $ upstream ; } return ( bool ) $ this -> execute ( $ args , $ dir , $ mustRun , false ) ; }
Create a new branch and check it out.

@param string      $name
@param string|null $parent
@param string|null $upstream
@param string|null $dir     The path to a Git repository.
@param bool        $mustRun Enable exceptions if the Git command fails.

@return bool
Create a new branch and check it out .