libgit2

git_repository_set_workdir

Version:

Set the path to the working directory for this repository

The working directory doesn't need to be the same one that contains the .git folder for this repository.

If this repository is bare, setting its working directory will turn it into a normal repository, capable of performing all the common workdir operations (checkout, status, index manipulation, etc).

Signature

int git_repository_set_workdir(git_repository *repo, const char *workdir);

Parameters

In
repo

A repository object

const char *
In
workdir

The path to a working directory

Returns

int

GIT_SUCCESS, or an error code

Versions