libgit2

git_repository_commondir

Version:

Get the path of the shared common directory for this repository.

If the repository is bare, it is the root directory for the repository. If the repository is a worktree, it is the parent repo's gitdir. Otherwise, it is the gitdir.

Signature

const char *git_repository_commondir(const git_repository *repo);

Parameters

In
repo

A repository object

Returns

const char *

the path to the common dir

Versions