---
title: "Compare two refs (commit/branch/workspace/tag/tree) in this repo"
method: GET
path: "/repos/{repo_id}/compare"
tags: ["Repository Content Comparison"]
---

# Compare two refs (commit/branch/workspace/tag/tree) in this repo

`GET /repos/{repo_id}/compare`

## Query parameters

- `base_id` string
- `other_id` string

## Response `200`

A list of tree comparison objects

- object
  - `object` 'ComparisonItem', required
  - `items` ComparisonItem[], required
    - `base_item` FileEntry
      - `path` string, required
      - `prev_path` string — Optional hint in case the item was renamed or moved
      - `status` 1 | 2 | 3 | 4, required — One of: 1 - INTACT, 2 - ADDED, 3 - MODIFIED, 4 - DELETED
      - `mode` 16877 | 33188 | 33261 | 40960, required — The file mode (as Unix mode)
      - `mtime` string, date-time
      - `blob` object
        - `storage_uri` string, required — Coupled with storage_backend, a uri to storage location
        - `storage_backend` 1 | 2, required — One of: 1 - EFS, 2 - S3
        - `size` integer, required — Size in bytes
        - `sha` string, required
    - `other_item` FileEntry
      - `path` string, required
      - `prev_path` string — Optional hint in case the item was renamed or moved
      - `status` 1 | 2 | 3 | 4, required — One of: 1 - INTACT, 2 - ADDED, 3 - MODIFIED, 4 - DELETED
      - `mode` 16877 | 33188 | 33261 | 40960, required — The file mode (as Unix mode)
      - `mtime` string, date-time
      - `blob` object
        - `storage_uri` string, required — Coupled with storage_backend, a uri to storage location
        - `storage_backend` 1 | 2, required — One of: 1 - EFS, 2 - S3
        - `size` integer, required — Size in bytes
        - `sha` string, required
    - `status` 1 | 2 | 3 | 4, required — One of: 1 - INTACT, 2 - ADDED, 3 - MODIFIED, 4 - DELETED
  - `cascaded_changes_count` integer, required — Number of cascaded changes, for insight of total compare size

---

[API](https://skmtc.net/diversion/apis/diversion-core-api.md) · [All operations](https://skmtc.net/diversion/apis/diversion-core-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/diversion/diversion-core-api/revisions/38a18aba804b/schema)
