---
title: "Retrieve a specific branch from a repository, including its effective branch protection"
method: GET
path: "/repos/{owner}/{repo}/branches/{branch}"
tags: ["repository"]
---

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

`GET /repos/{owner}/{repo}/branches/{branch}`

## Path parameters

- `owner` string, required
- `repo` string, required
- `branch` string, required

## Response `200`

Branch

- Branch — Branch represents a repository branch
  - `commit` PayloadCommit — PayloadCommit represents a commit
    - `added` string[] — List of files added in this commit
    - `author` PayloadUser — PayloadUser represents the author or committer of a commit
      - `email` string, email
      - `name` string — Full name of the commit author
      - `username` string — username of the user
    - `committer` PayloadUser — PayloadUser represents the author or committer of a commit
      - `email` string, email
      - `name` string — Full name of the commit author
      - `username` string — username of the user
    - `id` string — sha1 hash of the commit
    - `message` string — The commit message
    - `modified` string[] — List of files modified in this commit
    - `removed` string[] — List of files removed in this commit
    - `timestamp` string, date-time — The timestamp when the commit was made
    - `url` string — The URL to view this commit
    - `verification` PayloadCommitVerification — PayloadCommitVerification represents the GPG verification of a commit
      - `payload` string — The signed payload content
      - `reason` string — The reason for the verification status
      - `signature` string — The GPG signature of the commit
      - `signer` PayloadUser — PayloadUser represents the author or committer of a commit
        - `email` string, email
        - `name` string — Full name of the commit author
        - `username` string — username of the user
      - `verified` boolean — Whether the commit signature is verified
  - `effective_branch_protection_name` string — EffectiveBranchProtectionName is the name of the effective branch protection rule
  - `enable_status_check` boolean — EnableStatusCheck indicates if status checks are enabled
  - `name` string — Name is the branch name
  - `protected` boolean — Protected indicates if the branch is protected
  - `required_approvals` integer — RequiredApprovals is the number of required approvals for pull requests
  - `status_check_contexts` string[] — StatusCheckContexts contains the list of required status check contexts
  - `user_can_merge` boolean — UserCanMerge indicates if the current user can merge to this branch
  - `user_can_push` boolean — UserCanPush indicates if the current user can push to this branch

## Other responses

- `404` — APINotFound is a not found empty response

---

[API](https://skmtc.net/gitea/apis/gitea-api.md) · [All operations](https://skmtc.net/gitea/apis/gitea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitea/gitea-api/revisions/350de506cefa/schema)
