libgit2

git_apply

Version:

Apply a git_diff to the given repository, making changes directly in the working directory, the index, or both.

Signature

int git_apply(git_repository *repo, git_diff *diff, git_apply_location_t location, const git_apply_options *options);

Parameters

In
repo

the repository to apply to

In
diff

the diff to apply

In
location

the location to apply (workdir, index or both)

In
options

the options for the apply (or null for defaults)

Returns

int

0 or an error code

Versions