---
title: "List branches for HEAD commit"
method: GET
path: "/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
tags: ["repos"]
---

# List branches for HEAD commit

`GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head`

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](https://docs.github.com/enterprise-cloud@latest/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.

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

## Path parameters

- `owner` string, required
- `repo` string, required
- `commit_sha` string, required

## Response `200`

Response

- BranchShort[]
  - `name` string, required
  - `commit` object, required
    - `sha` string, required
    - `url` string, required
  - `protected` boolean, required

## Other responses

- `409` — Conflict
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-3.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-3/versions/dc0584ac4e13/schema)
