libgit2

git_repository_set_head_detached_from_annotated

Version:

Make the repository HEAD directly point to the Commit.

This behaves like git_repository_set_head_detached() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

See the documentation for git_repository_set_head_detached().

Signature

int git_repository_set_head_detached_from_annotated(git_repository *repo, const git_annotated_commit *committish);

Parameters

In
repo

Repository pointer

In
committish

annotated commit to point HEAD to

Returns

int

0 on success, or an error code

Versions