libgit2

git_cherrypick_commit

Version:

Cherry-picks the given commit against the given "our" commit, producing an index that reflects the result of the cherry-pick.

The returned index must be freed explicitly with git_index_free.

Signature

int git_cherrypick_commit(git_index **out, git_repository *repo, git_commit *cherrypick_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options);

Parameters

In
out

pointer to store the index result in

In
repo

the repository that contains the given commits

In
cherrypick_commit

the commit to cherry-pick

In
our_commit

the commit to revert against (eg, HEAD)

unsigned int
In
mainline

the parent of the revert commit, if it is a merge

In
merge_options

the merge options (or null for defaults)

Returns

int

zero on success, -1 on failure.

Versions