---
title: "Get the diff for a commit"
method: GET
path: "/version/diff"
tags: ["versioning"]
---

# Get the diff for a commit

`GET /version/diff`

Get the diff for a commit. Default is the latest commit (HEAD).

## Query parameters

- `commit` string
- `filename` string
- `diffLineLimit` integer

## Response `200`

a list of GitDiffResult objects

- CountedGitDiffResult
  - `count` integer — number of items present in the items array
  - `items` GitDiffResult[]
    - `diffJson` object[], required
      - `addedLines` number, required
      - `blocks` object[], required
        - `header` string, required
        - `lines` union[], required — Diff Line
          - union
            - DiffLineDelete
              - …
            - DiffLineInsert
              - …
            - DiffLineContext
              - …
        - `newStartLine` number, required
        - `oldStartLine` number, required
        - `oldStartLine2` number
      - `changedPercentage` number
      - `checksumAfter` string
      - `checksumBefore` union
        - string
        - string[]
      - `deletedFileMode` string
      - `deletedLines` number, required
      - `isBinary` boolean
      - `isCombined` boolean, required
      - `isCopy` boolean
      - `isDeleted` boolean
      - `isGitDiff` boolean, required
      - `isNew` boolean
      - `isRename` boolean
      - `isTooBig` boolean
      - `language` string, required
      - `mode` string
      - `newFileMode` string
      - `newMode` string
      - `newName` string, required
      - `oldMode` union
        - string
        - string[]
      - `oldName` string, required
      - `unchangedPercentage` number

## Other responses

- `401` — Unauthorized
- `500` — Unexpected error

## Changes

- **2026-03-06** `11df16b26c1d` — 1 breaking, 1 warning
  - for the `query` request parameter `diffLineLimit`, the type/format was changed from `number`/`` to `integer`/``
  - deleted the `query` request parameter `groupId`
- **2026-01-24** `84748faee3ef` — 1 breaking
  - added `#/components/schemas/DiffLineDelete, #/components/schemas/DiffLineInsert, #/components/schemas/DiffLineContext` to the `items/items/diffJson/items/blocks/items/lines/items/` response property `oneOf` list for the response status `200`
  - …this revision’s changelog is incomplete
- **2026-01-19** `62472462b0c0` — 1 breaking
  - added `subschema #1, subschema #2, subschema #3` to the `items/items/diffJson/items/blocks/items/lines/items/` response property `oneOf` list for the response status `200`
  - …this revision’s changelog is incomplete
- **2026-01-19** `78a6165ee901` — 1 breaking
  - added `#/components/schemas/DiffLineDelete, #/components/schemas/DiffLineInsert, #/components/schemas/DiffLineContext` to the `items/items/diffJson/items/blocks/items/lines/items/` response property `oneOf` list for the response status `200`
  - …this revision’s changelog is incomplete
- …earlier changes not shown

[Full history](https://skmtc.dev/criblio/apis/cribl-api-reference/changes/version/diff/get.md)

---

[API](https://skmtc.dev/criblio/apis/cribl-api-reference.md) · [All operations](https://skmtc.dev/criblio/apis/cribl-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/criblio/cribl-api-reference/revisions/11df16b26c1d/schema)
