git_commit_amend

Amend an existing commit by replacing only non-null values.

This creates a new commit that is exactly the same as the old commit, except that any non-null values will be updated. The new commit has the same parents as the old commit.

The update_ref value works as in the regular git_commit_create(), updating the ref to point to the newly rewritten commit. If you want to amend a commit that is not currently the tip of the branch and then rewrite the following commits to reach a ref, pass this as null and update the rest of the commit chain and ref separately.

Unlike git_commit_create(), the author, committer, message, message_encoding, and tree parameters can be null in which case this will use the values from the original commit_to_amend.

All parameters have the same meanings as in git_commit_create().

@see git_commit_create

Meta