---
title: "List commits between two revisions"
method: GET
path: "/api/repos/{namespace}/{repo_name}/compare/{base_head}/commits"
tags: ["Compare", "Commits"]
---

# List commits between two revisions

`GET /api/repos/{namespace}/{repo_name}/compare/{base_head}/commits`

## Request

- Base URL: `https://hub.oxen.ai`
- URL: `https://hub.oxen.ai/api/repos/{namespace}/{repo_name}/compare/{base_head}/commits`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/oxen/apis/oxen-server/docs/api/repos/:namespace/:repo_name/compare/:base_head/commits/get.ts> (a function with typed inputs; its response is checked against the schema)

List commits between a 'base' and 'head' commit. Two dots list what head added; three dots list the commits on either side but not both, each tagged with the side it came from.

## Path parameters

- `namespace` string, required
- `repo_name` string, required
- `base_head` string, required

## Query parameters

- `page` integer
- `page_size` integer

## Response `200`

Commits found successfully

- CompareCommitsResponse
  - `oxen_version` string, nullable
  - `status` string, required
  - `status_message` string, required
  - `page_number` integer, required
  - `page_size` integer, required
  - `total_entries` integer, required
  - `total_pages` integer, required
  - `compare` CompareCommits, required
    - `base_commit` Commit, required
      - `author` string, required
      - `email` string, required
      - `id` string, required
      - `message` string, required
      - `parent_ids` string[], required
      - `timestamp` string, date-time, required
    - `commits` CompareCommit[], required
      - `author` string, required
      - `email` string, required
      - `id` string, required
      - `message` string, required
      - `parent_ids` string[], required
      - `timestamp` string, date-time, required
      - `side` 'base' | 'head', required: Which side of a comparison a commit came from, mirroring the markers git's `log --left-right base...head` prints.
    - `head_commit` Commit, required
      - `author` string, required
      - `email` string, required
      - `id` string, required
      - `message` string, required
      - `parent_ids` string[], required
      - `timestamp` string, date-time, required

## Other responses

- `404`: Repository or one of the revisions not found

---

[API](https://skmtc.dev/oxen/apis/oxen-server.md) - [All operations](https://skmtc.dev/oxen/apis/oxen-server/llms.txt) - [OpenAPI document](https://skmtc.dev/oxen/apis/oxen-server/revisions/8021aa6fa5bc?raw)
