git.commits.list-files

List the files a commit changes, in pages

GET /git/api/repositories/{repoId}/commits/{sha}/filesIAM git:PullRepositoryReadSensitive read, audited

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

Path parameters

  • repoIdRequired

    string

    Constraints: uuid

  • shaRequired

    string

    Constraints: 1-255 chars

Query parameters

  • cursorOptional

    number

    `nextCursor` of the previous page; the first page when absent

    Constraints: integer, min 0

  • limitOptional

    number

    Files per page, at most 1000; 500 when absent

    Constraints: integer, 1-1000

  • ignoreWhitespaceOptional

    enum

    `true` to count lines as if whitespace did not matter (`git diff -w`); false when absent

    One of: true, false

Response

200 with `files`, `nextCursor`, `total`, and the `base` (the first parent, or the empty tree for a root commit) and `head` compared. 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

  • baseAlways

    string

    The commit the change is measured from (the merge base for a pull request)
  • headAlways

    string

    The commit with the change
  • filesAlways

    array of object

    This page of the changed files, in path order
  • files[].​pathAlways

    string

    The file's path after the change; for a deletion, before it
  • files[].​oldPathAlways

    string, may be null

    Where a renamed file came from; null otherwise
  • files[].​statusAlways

    one of added, modified, deleted, renamed

    What the change did to the file
  • files[].​binaryAlways

    boolean

    A binary file: counts are 0 and there are no rows
  • files[].​additionsAlways

    number

    Lines added
  • files[].​deletionsAlways

    number

    Lines removed
  • files[].​generatedAlways

    one of lock, generated, may be null

    A lock file or build output, collapsed by default; null for ordinary source
  • files[].​collapsedAlways

    one of large, generated, may be null

    Why the console folds the file until asked: `large` (more changed lines than the limit) or `generated`; null when shown at once
  • nextCursorAlways

    number, may be null

    Pass as `cursor` for the next page; null on the last
  • totalAlways

    object

    Totals over the whole change, the same on every page
  • total.​filesAlways

    number

    Changed files in the whole change
  • total.​additionsAlways

    number

    Lines added in the whole change
  • total.​deletionsAlways

    number

    Lines removed in the whole change
  • total.​listedAlways

    number

    Files the index lists; fewer than `files` only past the listing limit

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 list-files repoId sha

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_git_commits_list-files.