List branches
/repos/{owner}/{repo}/branches- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Path Parameters
- owner stringrequired
- repo stringrequired
Query Parameters
- protected booleanoptional
Setting to `true` returns only protected branches. When set to `false`, only unprotected branches are returned. Omitting this parameter returns all branches.
- per_page integeroptional
Results per page (max 100)
- page integeroptional
Page number of the results to fetch.
Responses
Response
Headers
<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last" items Short Branch objectShort Branch
Short Branch
commit objectrequired
protection Branch Protection objectoptionalBranch Protection
Branch Protection
allow_deletions objectoptional
allow_force_pushes objectoptional
enforce_admins Protected Branch Admin Enforced objectoptionalProtected Branch Admin Enforced
Protected Branch Admin Enforced
Example: true
Example: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins
Example: "branch/with/protection"
"https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection" required_conversation_resolution objectoptional
required_linear_history objectoptional
required_pull_request_reviews Protected Branch Pull Request Review objectoptionalProtected Branch Pull Request Review
Protected Branch Pull Request Review
Example: true
Example: true
Example: 2
https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions required_signatures objectoptional
Example: true
Example: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures
required_status_checks Protected Branch Required Status Check objectoptionalProtected Branch Required Status Check
Protected Branch Required Status Check
restrictions Branch Restriction Policy objectoptionalBranch Restriction Policy
Branch Restriction Policy
Resource not found