libgit2

git_checkout_tree

Version:

Updates files in the index and working tree to match the content of the tree pointed at by the treeish.

Signature

int git_checkout_tree(git_repository *repo, const git_object *treeish, git_checkout_opts *opts);

Parameters

In
repo

repository to check out (must be non-bare)

In
treeish

a commit, tag or tree which content will be used to update the working directory

In
opts

specifies checkout options (may be NULL)

Returns

int

0 on success, GIT_ERROR otherwise (use giterr_last for information about the error)

Versions