v5

latestSwagger 2.0MIT2026-08-03485217850.7 KB
repository

Create a branch

post/repos/{owner}/{repo}/branches

Path parameters

ownerstring required

owner of the repo

repostring required

name of the repo

Request body

new_branch_namestring required

Name of the branch to create

old_branch_namestring

Name of the old branch to create from

old_ref_namestring

Name of the old branch/tag/commit to create from

Response

Branch

effective_branch_protection_namestring

EffectiveBranchProtectionName is the name of the effective branch protection rule

enable_status_checkboolean

EnableStatusCheck indicates if status checks are enabled

namestring

Name is the branch name

protectedboolean

Protected indicates if the branch is protected

required_approvalsinteger

RequiredApprovals is the number of required approvals for pull requests

status_check_contextsstring[]

StatusCheckContexts contains the list of required status check contexts

user_can_mergeboolean

UserCanMerge indicates if the current user can merge to this branch

user_can_pushboolean

UserCanPush indicates if the current user can push to this branch