libgit2

git_repository_init

Version:

Creates a new Git repository in the given folder.

TODO: - Reinit the repository - Create config files

Signature

int git_repository_init(git_repository **repo_out, const char *path, unsigned int is_bare);

Parameters

git_repository **
In
repo_out

pointer to the repo which will be created or reinitialized

const char *
In
path

the path to the repository

unsigned int
In
is_bare

if true, a Git repository without a working directory is created at the pointed path. If false, provided path will be considered as the working directory into which the .git directory will be created.

Returns

int

0 on success; error code otherwise

Versions