Get a single commit
curl --request GET \
--url https://gogs.example.com/api/v1/repos/{owner}/{repo}/commits/{sha} \
--header 'Authorization: <api-key>'{
"url": "<string>",
"sha": "<string>",
"html_url": "<string>",
"commit": {
"url": "<string>",
"message": "<string>",
"author": {
"name": "<string>",
"email": "<string>",
"date": "<string>"
},
"committer": {
"name": "<string>",
"email": "<string>",
"date": "<string>"
},
"tree": {
"url": "<string>",
"sha": "<string>"
}
},
"author": {
"id": 123,
"username": "<string>",
"login": "<string>",
"full_name": "<string>",
"email": "jsmith@example.com",
"avatar_url": "<string>"
},
"committer": {
"id": 123,
"username": "<string>",
"login": "<string>",
"full_name": "<string>",
"email": "jsmith@example.com",
"avatar_url": "<string>"
},
"parents": [
{
"url": "<string>",
"sha": "<string>"
}
]
}Repositories
Get a single commit
Get details for a single commit. Set Accept header to application/vnd.gogs.sha to return only the SHA-1 hash of a commit reference.
GET
/
repos
/
{owner}
/
{repo}
/
commits
/
{sha}
Get a single commit
curl --request GET \
--url https://gogs.example.com/api/v1/repos/{owner}/{repo}/commits/{sha} \
--header 'Authorization: <api-key>'{
"url": "<string>",
"sha": "<string>",
"html_url": "<string>",
"commit": {
"url": "<string>",
"message": "<string>",
"author": {
"name": "<string>",
"email": "<string>",
"date": "<string>"
},
"committer": {
"name": "<string>",
"email": "<string>",
"date": "<string>"
},
"tree": {
"url": "<string>",
"sha": "<string>"
}
},
"author": {
"id": 123,
"username": "<string>",
"login": "<string>",
"full_name": "<string>",
"email": "jsmith@example.com",
"avatar_url": "<string>"
},
"committer": {
"id": 123,
"username": "<string>",
"login": "<string>",
"full_name": "<string>",
"email": "jsmith@example.com",
"avatar_url": "<string>"
},
"parents": [
{
"url": "<string>",
"sha": "<string>"
}
]
}Authorizations
Personal access token. Use format: token {YOUR_ACCESS_TOKEN}
Path Parameters
Repository owner
Repository name
Commit SHA