Sample - GitHub REST API
GET/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head

List branches for HEAD commit

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
commit_shastringrequired
The SHA of the commit.

3 status codes
200Response
namestringrequired
commitobjectrequired
protectedbooleanrequired
409Conflict
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Validation failed, or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 409 is returned: Conflict. A 422 is returned: Validation failed, or the endpoint has been spammed.