libgit2

git_branch_delete

Version:

Delete an existing branch reference.

Signature

int git_branch_delete(git_repository *repo, const char *branch_name, git_branch_t branch_type);

Parameters

In
repo

Repository where lives the branch.

const char *
In
branch_name

Name of the branch to be deleted; this name is validated for consistency.

In
branch_type

Type of the considered branch. This should be valued with either GIT_BRANCH_LOCAL or GIT_BRANCH_REMOTE.

Returns

int

0 on success, GIT_ENOTFOUND if the branch doesn't exist or an error code.

Versions