libgit2

git_worktree_add

Version:

Add a new working tree

Add a new working tree for the repository, that is create the required data structures inside the repository and check out the current HEAD at path

Signature

int git_worktree_add(git_worktree **out, git_repository *repo, const char *name, const char *path, const git_worktree_add_options *opts);

Parameters

In
out

Output pointer containing new working tree

In
repo

Repository to create working tree for

const char *
In
name

Name of the working tree

const char *
In
path

Path to create working tree at

In
opts

Options to modify default behavior. May be NULL

Returns

int

0 or an error code

Versions