libgit2

git_merge

Version:

Merges the given commit(s) into HEAD, writing the results into the working directory. Any changes are staged for commit and any conflicts are written to the index. Callers should inspect the repository's index after this completes, resolve any conflicts and prepare a commit.

Signature

int git_merge(git_repository *repo, const git_merge_head **their_heads, size_t their_heads_len, const git_merge_options *merge_opts, const git_checkout_options *checkout_opts);

Parameters

In
repo

the repository to merge

In
their_heads

the heads to merge into

size_t
In
their_heads_len

the number of heads to merge

In
merge_opts

merge options

In
checkout_opts

checkout options

Returns

int

0 on success or error code

Versions