libgit2

git_commit_amend_from_stage

Version:

Amends the HEAD commit in the repository using the staged changes; this is a near analog to git commit --amend -m message.

Signature

int git_commit_amend_from_stage(git_oid *id, git_repository *repo, const char *message, const git_commit_create_options *opts);

Parameters

In
id

pointer to store the new commit's object id

In
repo

repository to commit changes in

const char *
In
message

the commit message

In
opts

options for creating the commit

Returns

int

0 on success or an error code

Versions