v5

latestSwagger 2.0MIT2026-08-03485217850.7 KB
repository

Get commit comparison information

By default returns JSON commit comparison information. The raw diff or patch can be requested with the output query parameter set to diff or patch respectively.

get/repos/{owner}/{repo}/compare/{basehead}

Path parameters

ownerstring required

owner of the repo

repostring required

name of the repo

baseheadstring required

compare two refs as base...head (or base..head); refs may be branches, tags, full or short SHAs (including branch names that contain slashes), optionally with a ^ or ~N revision suffix.

Query parameters

output'diff' | 'patch'

return the raw comparison as diff or patch instead of JSON

Response

total_commitsinteger