Options
string
required
Commit SHA to fetch metadata for. Any revision Git can resolve is accepted (full SHA, short SHA,
branch name, tag).
Response
object
Commit metadata. Extends the shape returned by
listCommits() with two signature fields that are
only populated on this single-commit endpoint.commit object contains:
shaparentShas— parent commit SHAs in Git parent order; empty for root commits. Python:parent_shas; Go:ParentSHAs.messageauthorName,authorEmailcommitterName,committerEmaildate(parsedDatein TypeScript,datetimein Python,time.Timein Go)rawDate(RFC 3339 string as returned by the server)signature— the armored signature taken from the commit’s signature header. Omitted for unsigned commits.payload— the exact bytes the signature is computed over. Omitted for unsigned commits.
signature/payload pair mirrors GitHub’s commit verification object, so you can verify a
signature yourself by checking signature against payload:
TypeScript
Notes
- This endpoint does not compute or return the commit diff. Use
getCommitDiff()when you need file changes as well. - For listing many commits at once, prefer
listCommits()— the per-commit shape is identical except thatsignatureandpayloadare only returned bygetCommit(). signatureandpayloadlet clients verify commit signatures independently. The server enforces signatures at push time through theverify-sigbranch-protection policy.