List Repo Branches
List branches for a GitHub repo so the dashboard form can offer a branch picker at index time.
Public repos use anon GitHub API. Private repos resolve through the caller's GitHub App installation token — keeping the same ACL model as /repos/index so a private repo never leaks its branch list to a non-installed user.
One page of 100 is the whole budget. Paginating to completion would be 15 sequential calls on a repo like langchain-ai/langchain against an anon hourly quota of 60, per settled keystroke. Two things make one page enough instead:
- The default branch is pinned, never merely hoped for. GitHub pages branches alphabetically, so master sits outside page one on that repo and the picker could not offer it at all — the whole reason this endpoint grew an envelope.
- q searches server-side through git/matching-refs, which prefix-matches across every ref in one call, so a branch beyond page one is reachable by typing rather than by paging.
truncated tells the caller its list is partial so it can say so; a silent cap reads to the user as "these are all the branches".
Query parameters
Prefix-match branch names, e.g. 'release/' or 'mas'.
Prefix-match branch names, e.g. 'release/' or 'mas'.
Response
Successful Response
Changes
No recorded changes to this endpoint across all 1 revision of this API.