git.commits.file-diffRead one file's diff in a commit, in pages of rows
Paged: a large change is read a page of files and a page of rows at a time, never as one payload. A file with more than 1,500 changed lines, or a lock file or build output, has `collapsed` set (the console folds it until asked); a file whose patch is over 16 MiB answers `state: too-large`. Lines longer than 10,000 characters are cut, with the number left out in `cut`.
Request syntax
GET /git/api/repositories/{repoId}/commits/{sha}/files/diffPath parameters
repoIdRequiredstring
Constraints: uuid
shaRequiredstring
Constraints: 1-255 chars
Query parameters
pathRequiredstring
The file, as the file list names it
Constraints: 1-4096 chars
oldPathOptionalstring
A renamed file's `oldPath` from the file list, so the rename is followed
Constraints: 1-4096 chars
offsetOptionalnumber
`nextOffset` of the previous page; the first row when absent
Constraints: integer, min 0
limitOptionalnumber
Rows per page, at most 5000; 1000 when absent
Constraints: integer, 1-5000
layoutOptionalenum
`unified` (the default) one row per line; `split` old and new side by side
One of:
unified,splithighlightOptionalenum
`true` to add syntax-highlighted HTML to each line; false when absent
One of:
true,falseignoreWhitespaceOptionalenum
`true` to leave out changes that only touch whitespace; false when absent
One of:
true,falsebaseOptionalstring
The `base` commit the file list answered with: pass both so every page describes the same change if a branch moves meanwhile; the current one when absent
Constraints: /^[0-9a-f]{40}(?:[0-9a-f]{24})?$/
headOptionalstring
The `head` commit the file list answered with: pass both so every page describes the same change if a branch moves meanwhile; the current one when absent
Constraints: /^[0-9a-f]{40}(?:[0-9a-f]{24})?$/
Response
200 with `state`, `rows`, `totalRows`, `nextOffset` and `hunks`. 404 for an unknown commit.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Fields of data
pathAlwaysstring
The file, as asked foroldPathAlwaysstring, may be null
Where a renamed file came from; null otherwisestatusAlwaysone of added, modified, deleted, renamed
What the change did to the filebinaryAlwaysboolean
A binary file: no rowslayoutAlwaysone of unified, split
`split` pairs old and new lines side by sidestateAlwaysone of ok, binary, too-large, no-changes, missing
`ok` with rows; `binary`; `too-large` (the patch is over 16 MiB); `no-changes` (a pure rename or a mode change, or only whitespace when it is ignored); `missing` (the path is not part of this change)totalRowsAlwaysnumber
Rows the file has in this layout, hunk headers includedoffsetAlwaysnumber
Index of the first row in `rows`rowsAlwaysarray of one of several shapes
This page of rowsnextOffsetAlwaysnumber, may be null
Pass as `offset` for the next page; null on the lasthunksAlwaysarray of object
Every hunk of the file with its line ranges, on every pagehunks[].rowAlwaysnumber
Index of the hunk's header row in this layouthunks[].oldStartAlwaysnumber
First old-side line of the hunkhunks[].oldCountAlwaysnumber
Old-side lines the hunk spanshunks[].newStartAlwaysnumber
First new-side line of the hunkhunks[].newCountAlwaysnumber
New-side lines the hunk spansmaxLineCharsAlwaysnumber
Length of the longest line in the file, as sentlastOldLineAlwaysnumber
Last old-side line the diff shows (for the tail expander)lastNewLineAlwaysnumber
Last new-side line the diff showshighlightedAlwaysboolean
Rows carry `html`patchBytesAlwaysnumber
Size of the file's patch
Checked against the handlers: every route test validates their answers against this schema.
Errors
- 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
- 401No credentials, or an access key that is unknown, revoked or expired.
- 403The caller's policies do not allow git:PullRepository on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
- 404The resource does not exist in your organization.
Examples
The required parameters only, with example values. Replace id and the other placeholders with your own.
dcloud git commits file-diff repoId sha --path examplecurl -X GET "https://console.platform.deutschecloud.app/git/api/repositories/repoId/commits/sha/files/diff" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY"import { DcloudClient } from '@dcloud/sdk';
const client = new DcloudClient();
const result = await client.git.commits.fileDiff({ repoId: "repoId", sha: "sha", path: "example" });from dcloud import Client
client = Client()
result = client.git.commits.file_diff(repo_id="repoId", sha="sha", path="example")Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_git_commits_file-diff.