libgit2

git_branch_move

Version:

Move/rename an existing local branch reference.

The new branch name will be checked for validity. See git_tag_create() for rules about valid names.

Signature

int git_branch_move(git_reference **out, git_reference *branch, const char *new_branch_name, int force, const git_signature *signature, const char *log_message);

Parameters

In
branch

Current underlying reference of the branch.

const char *
In
new_branch_name

Target name of the branch once the move is performed; this name is validated for consistency.

int
In
force

Overwrite existing branch.

In
signature

The identity that will used to populate the reflog entry

const char *
In
log_message

The one line long message to be appended to the reflog

Returns

int

0 on success, GIT_EINVALIDSPEC or an error code.

Versions