v5

latestSwagger 2.0MIT2026-08-03485217850.7 KB
repository

Retrieve a specific branch from a repository, including its effective branch protection

get/repos/{owner}/{repo}/branches/{branch}

Path parameters

ownerstring required

owner of the repo

repostring required

name of the repo

branchstring required

branch to get

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