octokit.rest

List branches

Parameters

string The token will be passed in the authorization header.

string

string

boolean Setting to true returns only protected branches. When set to false, only unprotected branches are returned. Omitting this parameter returns all branches.

integer Results per page (max 100)

integer Page number of the results to fetch.

Request

GET https://api.github.com/repos///branches
authorization: bearer undefined
accept: application/vnd.github.v3+json
user-agent: octokit.rest


Example Response

Status: 200
[
  {
    "name": "master",
    "commit": {
      "sha": "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc",
      "url": "https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc"
    },
    "protected": true
  }
]

See documentation on GitHub developer guides