libgit2

git_checkout_head

Version:

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

Signature

int git_checkout_head(git_repository *repo, const git_checkout_opts *opts);

Parameters

In
repo

repository to check out (must be non-bare)

In
opts

specifies checkout options (may be NULL)

Returns

int

0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing branch, GIT_ERROR otherwise (use giterr_last for information about the error)

Versions