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, const 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 (or NULL to use HEAD)

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