commit_sha parameter
List branches for HEAD commit
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub’s products in the GitHub Help documentation.
Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.
Path Parameters
Response
application/json
Response
Response
Branch Short
Show Child Parameters
Path Parameters
List commit comments
Use the :commit_sha
to specify the commit that will have its comments listed.
Query Parameters
Results per page (max 100)
Default:30
Page number of the results to fetch.
Default:1
Path Parameters
commit_sha parameter
Response
200 application/json
Response
Response
Commit Comment
Simple User
Show Child Parameters
How the author is associated with the repository.
Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
Example:OWNER
Show Child Parameters
Path Parameters
Query Parameters
Create a commit comment
Create a comment for a commit using its :commit_sha
.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See “Secondary rate limits” and “Dealing with secondary rate limits” for details.
Path Parameters
commit_sha parameter
Body
application/json
Body
The contents of the comment.
Relative path of the file to comment on.
Line index in the diff to comment on.
Deprecated. Use position parameter instead. Line number in the file to comment on.
Response
application/json
Response
Response
Commit Comment
Commit Comment
Simple User
Show Child Parameters
How the author is associated with the repository.
Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
Example:OWNER
Show Child Parameters
Path Parameters
Body
List pull requests associated with a commit
Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit. The results may include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the List pull requests endpoint.
Query Parameters
Results per page (max 100)
Default:30
Page number of the results to fetch.
Default:1
Path Parameters
commit_sha parameter
Response
200 application/json
Response
Response
Pull Request Simple
Example:https://api.github.com/repos/octocat/Hello-World/pulls/1347
Example:1
Example:MDExOlB1bGxSZXF1ZXN0MQ==
Example:https://github.com/octocat/Hello-World/pull/1347
Example:https://github.com/octocat/Hello-World/pull/1347.diff
Example:https://github.com/octocat/Hello-World/pull/1347.patch
Example:https://api.github.com/repos/octocat/Hello-World/issues/1347
Example:https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits
Example:https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments
Example:https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}
Example:https://api.github.com/repos/octocat/Hello-World/issues/1347/comments
Example:https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e
Example:1347
Example:open
Example:true
Example:new-feature
Simple User
Show Child Parameters
Example:Please pull these awesome changes
Show Child Parameters
A collection of related issues and pull requests.
Show Child Parameters
Example:too heated
Example:2011-01-26T19:01:12Z
Example:2011-01-26T19:01:12Z
Example:2011-01-26T19:01:12Z
Example:2011-01-26T19:01:12Z
Example:e5bd3914e2e596debea16f433f57875b5b90bcd6
Simple User
Show Child Parameters
Simple User
Show Child Parameters
Simple User
Show Child Parameters
Groups of organization members that gives permissions on specified repositories.
Show Child Parameters
Show Child Parameters
Show Child Parameters
Show Child Parameters
How the author is associated with the repository.
Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
Example:OWNER
Indicates whether or not the pull request is a draft.
Example:false
Path Parameters
Query Parameters
Get a commit
Returns the contents of a single commit reference. You must have read
access for the repository to use this endpoint.
Note: If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.
You can pass the appropriate media type to fetch diff
and patch
formats. Diffs with binary data will have no patch
property.
To return only the SHA-1 hash of the commit reference, you can provide the sha
custom media type in the Accept
header. You can use this endpoint to check if a remote reference’s SHA-1 hash is the same as your local reference’s SHA-1 hash by providing the local SHA-1 reference as the ETag.
Signature verification object
The response will include a verification
object that describes the result of verifying the commit’s signature. The following fields are included in the verification
object:
Name | Type | Description |
---|---|---|
verified |
boolean |
Indicates whether GitHub considers the signature in this commit to be verified. |
reason |
string |
The reason for verified value. Possible values and their meanings are enumerated in table below. |
signature |
string |
The signature that was extracted from the commit. |
payload |
string |
The value that was signed. |
These are the possible values for reason
in the verification
object:
Value | Description |
---|---|
expired_key |
The key that made the signature is expired. |
not_signing_key |
The “signing” flag is not among the usage flags in the GPG key that made the signature. |
gpgverify_error |
There was an error communicating with the signature verification service. |
gpgverify_unavailable |
The signature verification service is currently unavailable. |
unsigned |
The object does not include a signature. |
unknown_signature_type |
A non-PGP signature was found in the commit. |
no_user |
No user was associated with the committer email address in the commit. |
unverified_email |
The committer email address in the commit was associated with a user, but the email address is not verified on her/his account. |
bad_email |
The committer email address in the commit is not included in the identities of the PGP key that made the signature. |
unknown_key |
The key that made the signature has not been registered with any user’s account. |
malformed_signature |
There was an error parsing the signature. |
invalid |
The signature could not be cryptographically verified using the key whose key-id was found in the signature. |
valid |
None of the above errors applied, so the signature is considered to be verified. |
Query Parameters
Page number of the results to fetch.
Default:1
Results per page (max 100)
Default:30
Path Parameters
ref parameter
Response
application/json
Response
Response
Commit
Commit
Example:https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e
Example:6dcb09b5b57875f334f61aebed695e2e4193db5e
Example:MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==
Example:https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e
Example:https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments
Show Child Parameters
Simple User
Show Child Parameters
Simple User
Show Child Parameters
Show Child Parameters
Show Child Parameters
Diff Entry