libgit2

git_repository_set_bare

Version:

Set a repository to be bare.

Clear the working directory and set core.bare to true. You may also want to call git_repository_set_index(repo, NULL) since a bare repo typically does not have an index, but this function will not do that for you.

Signature

int git_repository_set_bare(git_repository *repo);

Parameters

In
repo

Repo to make bare

Returns

int

0 on success, < 0 on failure

Versions