repository

List a repository's branches

Changed on
get/repos/{owner}/{repo}/branches

Request

  • Base URL
    https://demo.gitea.com/api/v1
  • Auth
    • HTTP basic
    • or API key in query parameter token
    • or API key in query parameter access_token
    • or API key in header Authorization
    • or API key in query parameter sudo
    • or API key in header Sudo
    • or API key in header X-GITEA-OTP
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Path parameters

ownerstring required

owner of the repo

repostring required

name of the repo

Query parameters

pageinteger

page number of results to return (1-based)

limitinteger

page size of results

qstring

branch name substring to filter by

Response

BranchList

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

Changes