Skip to content

Get a single commit from a repository

GET
/repos/{owner}/{repo}/git/commits/{sha}
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

sha
required
string

A git ref or commit sha

stat
boolean

Include diff stats for every commit (disable for speedup, default ‘true’)

verification
boolean

Include verification for every commit (disable for speedup, default ‘true’)

files
boolean

Include a list of affected files for every commit (disable for speedup, default ‘true’)

Commit

Media type application/json
Commit contains information generated from a Git commit.
object
author

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s profile page

string
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

The user’s username

string
login_name

The user’s authentication sign-in name.

string
default: empty
prohibit_login

Is user login prohibited

boolean
pronouns

The user’s pronouns

string
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
website

The user’s website

string
commit
RepoCommit contains information of a commit in the context of a repository.
object
author
CommitUser contains information of a user in the context of a commit.
object
date
string
email
string format: email
name
string
committer
CommitUser contains information of a user in the context of a commit.
object
date
string
email
string format: email
name
string
message
string
tree
CommitMeta contains meta information of a commit in terms of API.
object
created
string format: date-time
sha
string
url
string
url
string
verification

PayloadCommitVerification represents the GPG verification of a commit

object
payload
string
reason
string
signature
string
signer

PayloadUser represents the author or committer of a commit

object
email
string format: email
name

Full name of the commit author

string
username
string
verified
boolean
committer

User represents a user

object
active

Is user active

boolean
avatar_url

URL to the user’s avatar

string
created
string format: date-time
description

The user’s description

string
email
string format: email
followers_count

User counts

integer format: int64
following_count
integer format: int64
full_name

The user’s full name

string
html_url

URL to the user’s profile page

string
id

The user’s id

integer format: int64
is_admin

Is the user an administrator

boolean
language

User locale

string
last_login
string format: date-time
location

The user’s location

string
login

The user’s username

string
login_name

The user’s authentication sign-in name.

string
default: empty
prohibit_login

Is user login prohibited

boolean
pronouns

The user’s pronouns

string
restricted

Is user restricted

boolean
source_id

The ID of the user’s Authentication Source

integer format: int64
starred_repos_count
integer format: int64
visibility

User visibility level option: public, limited, private

string
website

The user’s website

string
created
string format: date-time
files
Array<object>

CommitAffectedFiles store information about files affected by the commit

object
filename
string
status
string
html_url
string
parents
Array<object>
CommitMeta contains meta information of a commit in terms of API.
object
created
string format: date-time
sha
string
url
string
sha
string
stats

CommitStats is statistics for a RepoCommit

object
additions
integer format: int64
deletions
integer format: int64
total
integer format: int64
url
string
Example
{
"author": {
"login_name": "empty"
},
"committer": {
"login_name": "empty"
}
}

APINotFound is a not found error response

Media type application/json
object
errors
Array<string>
message
string
url
string
Example generated
{
"errors": [
"example"
],
"message": "example",
"url": "example"
}

APIValidationError is error format response related to input validation

Media type application/json
object
message
string
url
string
Example generated
{
"message": "example",
"url": "example"
}