src/Gitonomy/Git/Admin.php
public static function init($path, $bare = true, array $options = array())
    {
        $process = static::getProcess('init', array_merge(array('-q'), $bare ? array('--bare') : array(), array($path)), $options);

        $process->run();

        if (!$process->isSuccessFul()) {
            throw new RuntimeException(sprintf("Error on repository initialization, command wasn't successful (%s). Error output:\n%s", $process->getCommandLine(), $process->getErrorOutput()));
        }

        return new Repository($path, $options);
    }
public static function init($path, $bare = true, array $options = array())
    {
        $process = static::getProcess('init', array_merge(array('-q'), $bare ? array('--bare') : array(), array($path)), $options);

        $process->run();

        if (!$process->isSuccessFul()) {
            throw new RuntimeException(sprintf("Error on repository initialization, command wasn't successful (%s). Error output:\n%s", $process->getCommandLine(), $process->getErrorOutput()));
        }

        return new Repository($path, $options);
    }
Initializes a repository and returns the instance.

@param string $path    path to the repository
@param bool   $bare    indicate to create a bare repository
@param array  $options options for Repository creation

@return Repository

@throws RuntimeException Directory exists or not writable (only if debug=true)