Skip to main content
GET
Get Commit Diff

Authorizations

Authorization
string
header
required

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

repo_name
string
required

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

ref
string

Branch, tag, or commit to diff. Provide ref or the deprecated sha.

sha
string

Deprecated: use ref instead. Commit SHA to diff.

base_ref
string

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.

baseSha
string

Deprecated: use base_ref instead. Optional base commit SHA to diff against. When omitted, the diff is generated against the commit's parent.

ref_is_ephemeral
boolean

Whether ref should be resolved from the ephemeral namespace.

base_is_ephemeral
boolean

Whether base_ref should be resolved from the ephemeral namespace.

path
string[]

Optional repeated path filter. Provide multiple path query values to restrict the diff to specific files or directories.

git_apply_compatible
boolean

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.

gitApplyCompatible
boolean

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
object[]
required

Files returned with inline diff content.

filtered_files
object[]
required

Files filtered out of inline diff output because of size or file-type rules.

sha
string
required

The commit SHA to diff.

Example:

"b003fc78805954584e1ee364a4ad39d7c79e819a"

stats
object
required

Aggregate diff statistics.

base_sha
string

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.

Example:

"a2d127e6a4d54bb7390de828a99e36411f0c84df"

merge_base_sha
string

Merge base SHA used for explicit baseSha three-dot comparisons. Empty for single-commit diffs.

Example:

"a2d127e6a4d54bb7390de828a99e36411f0c84df"