public function init($dir, $mustRun = false)
    {
        if (is_dir($dir . '/.git')) {
            throw new \InvalidArgumentException("Already a repository: $dir");
        }

        return (bool) $this->execute(['init'], $dir, $mustRun, false);
    }
public function init($dir, $mustRun = false)
    {
        if (is_dir($dir . '/.git')) {
            throw new \InvalidArgumentException("Already a repository: $dir");
        }

        return (bool) $this->execute(['init'], $dir, $mustRun, false);
    }
public function init ( $ dir , $ mustRun = false ) { if ( is_dir ( $ dir . '/.git' ) ) { throw new \ InvalidArgumentException ( "Already a repository: $dir" ) ; } return ( bool ) $ this -> execute ( [ 'init' ] , $ dir , $ mustRun , false ) ; }
Create a Git repository in a directory.

@param string $dir
@param bool   $mustRun
Enable exceptions if the Git command fails.

@return bool
Create a Git repository in a directory .