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_options *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, non-zero return value from notify_cb, or error code < 0 (use giterr_last for error details)

Versions