libgit2

git_repository_init

Version:

Creates a new Git repository in the given folder.

TODO: - Reinit the repository

Signature

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

Parameters

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

GIT_SUCCESS or an error code

Versions