Get Commit Diff
Get the diff for a commit, optionally relative to a specific base commit. Repeated path parameters narrow the diff to selected files or directories.
JWT claims
Required scopes: git:read
Requires per repo scope: Yes
Authorizations
JWT bearer token signed with your organization's registered signing key. There is no OAuth authorization server; you mint tokens yourself and the token's scopes claim carries the granted permission scopes. Public scopes: git:read (read repository contents), git:write (write branches, commits, tags, and notes), repo:write (create and manage repositories), org:read (list an organization's repositories). Each operation's security requirement names the scopes it requires. See https://code.storage/docs/getting-started/authentication for how to mint tokens.
Path Parameters
Repository name. Names that contain / or any other character that is not safe in a URL path segment must be URL encoded so the value occupies a single path segment. For example pierre/example is sent as pierre%2Fexample. Plain names such as example can be sent as-is. The server URL-decodes the value before resolving the repository.
Query Parameters
Branch, tag, or commit to diff. Provide ref or the deprecated sha.
Deprecated: use ref instead. Commit SHA to diff.
Optional base branch, tag, or commit to diff against. When omitted, the diff is generated against the commit's parent. Provide base_ref or the deprecated baseSha.
Deprecated: use base_ref instead. Optional base commit SHA to diff against. When omitted, the diff is generated against the commit's parent.
Whether ref should be resolved from the ephemeral namespace.
Whether base_ref should be resolved from the ephemeral namespace.
Optional repeated path filter. Provide multiple path query values to restrict the diff to specific files or directories.
When enabled, concatenate files[].raw in response order and apply the result against the selected base with git apply. Changes listed in filtered_files are not included in the patch. Defaults to false, preserving review-oriented whitespace suppression. Provide git_apply_compatible or the deprecated gitApplyCompatible.
Deprecated: use git_apply_compatible instead. When enabled, concatenate files[].raw in response order and apply the result against the selected base with git apply. Changes listed in filtered_files are not included in the patch. Defaults to false, preserving review-oriented whitespace suppression.
Response
Full diff for the requested commit, including file-level stats, line-level hunks, and merge base for explicit base comparisons.
Diff for a single commit, including merge base when applicable, aggregate stats, and per-file changes.
Files returned with inline diff content.
Files filtered out of inline diff output because of size or file-type rules.
The commit SHA to diff.
"b003fc78805954584e1ee364a4ad39d7c79e819a"
Aggregate diff statistics.
The commit that the base revision (base_ref) resolved to. Empty for a single-commit diff. Use it to record the exact base of the comparison.
"a2d127e6a4d54bb7390de828a99e36411f0c84df"
Merge base SHA used for explicit baseSha three-dot comparisons. Empty for single-commit diffs.
"a2d127e6a4d54bb7390de828a99e36411f0c84df"