Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!

Get a commit's diff or patch

GET
/repos/{owner}/{repo}/git/commits/{sha}.{diffType}
curl --request GET \
--url https://gitea.com/api/v1/repos/example/example/git/commits/example.diff \
--header 'Authorization: Basic <credentials>'
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
Allowed values: diff patch

Whether the output is diff or patch

APIString is a string response

Media typeapplication/json
string
Examplegenerated
example

APINotFound is a not found empty response