---
title: "List Branches"
method: GET
path: "/api/repos/{namespace}/{repository}/branches"
tags: ["repository"]
---

# List Branches

`GET /api/repos/{namespace}/{repository}/branches`

## Request

- Base URL: `https://api.git.mari.zip` (the document declares no server; this is the origin it was published from)
- URL: `https://api.git.mari.zip/api/repos/{namespace}/{repository}/branches`
- Auth: one of:
  - none
  - API key in cookie `gitarena-session`
- TypeScript: <https://skmtc.dev/mari/apis/gitarena/docs/api/repos/:namespace/:repository/branches/get.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `namespace` string, required
- `repository` string, required

## Response `200`

List of branches with commit counts and ahead/behind relative to the default branch

- BranchesResponse
  - `branches` BranchInfo[], required: List of branches
    - `ahead` integer, required: Number of commits the branch is ahead versus the default branch
    - `behind` integer, required: Number of commits the branch is behind versus the default branch
    - `commitCount` integer, required: Total number of commits
    - `name` string, required: Branch name

## Other responses

- `404`: Repository not found or access denied

## Changes

- **2026-10-29** `efaeb85ac1be`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mari/apis/gitarena/changes/api/repos/:namespace/:repository/branches/get.md)

---

[API](https://skmtc.dev/mari/apis/gitarena.md) - [All operations](https://skmtc.dev/mari/apis/gitarena/llms.txt) - [OpenAPI document](https://skmtc.dev/mari/apis/gitarena/revisions/437eec085d26?raw)
