repository

Get commit comparison information

Changed on

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}

Request

  • Base URL
    https://demo.gitea.com/api/v1
  • Auth
    • HTTP basic
    • or API key in query parameter token
    • or API key in query parameter access_token
    • or API key in header Authorization
    • or API key in query parameter sudo
    • or API key in header Sudo
    • or API key in header X-GITEA-OTP

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

verificationboolean

include verification for every commit (disable for speedup, default 'true')

filesboolean

include a list of affected files for every commit (disable for speedup, default 'true')

Response

total_commitsinteger

Changes