Skip to main content
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": "[email protected]",
    "avatar_url": "<string>"
  },
  "committer": {
    "id": 123,
    "username": "<string>",
    "login": "<string>",
    "full_name": "<string>",
    "email": "[email protected]",
    "avatar_url": "<string>"
  },
  "parents": [
    {
      "url": "<string>",
      "sha": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Personal access token. Use format: token {YOUR_ACCESS_TOKEN}

Path Parameters

owner
string
required

Repository owner

repo
string
required

Repository name

sha
string
required

Commit SHA

Response

Success

url
string
sha
string
html_url
string
commit
object
author
object
committer
object
parents
object[]