Get a commit's diff or patch
GET
/repos/{owner}/{repo}/git/commits/{sha}.{diffType}
const url = 'https://gitea.example.com/api/v1/repos/example/example/git/commits/example.diff';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://gitea.example.com/api/v1/repos/example/example/git/commits/example.diff \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”owner
required
string
Owner of the repo
repo
required
string
Name of the repo
sha
required
string
SHA of the commit to get
diffType
required
string
Whether the output is diff or patch
Responses
Section titled “Responses”APIString is a string response
Media typetext/plain
string
APINotFound is a not found empty response
Media typetext/plain