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
Deprecated: Use /api/repos/{repo_name}/diff instead.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Commit SHA to diff.
Optional base commit SHA to diff against. When omitted, the diff is generated against the commit's parent.
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.
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.
Merge base SHA used for explicit baseSha three-dot comparisons. Empty for single-commit diffs.
"a2d127e6a4d54bb7390de828a99e36411f0c84df"