> ## Documentation Index
> Fetch the complete documentation index at: https://code.storage/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getCommit()

> Get metadata for a single commit without computing its diff.

<CodeGroup>
  ```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  const { commit } = await repo.getCommit({
    sha: 'abc123def456...',
  });

  console.log(commit.message);
  console.log(`${commit.authorName} <${commit.authorEmail}>`);
  console.log(commit.parentShas);
  console.log(commit.date.toISOString());
  ```

  ```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  result = await repo.get_commit(sha="abc123def456")
  commit = result["commit"]

  print(commit["message"])
  print(f"{commit['author_name']} <{commit['author_email']}>")
  print(commit["parent_shas"])
  print(commit["date"].isoformat())
  ```

  ```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  result, err := repo.GetCommit(context.Background(), storage.GetCommitOptions{
  	SHA: "abc123def456",
  })
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Println(result.Commit.Message)
  fmt.Printf("%s <%s>\n", result.Commit.AuthorName, result.Commit.AuthorEmail)
  fmt.Println(result.Commit.ParentSHAs)
  fmt.Println(result.Commit.Date.Format(time.RFC3339))
  ```
</CodeGroup>

## Options

<ParamField path="sha" type="string" required>
  Commit SHA to fetch metadata for. Any revision Git can resolve is accepted (full SHA, short SHA,
  branch name, tag).
</ParamField>

## Response

<ResponseField name="commit" type="object">
  Commit metadata. Extends the shape returned by `listCommits()` with two signature fields that are
  only populated on this single-commit endpoint.
</ResponseField>

The `commit` object contains:

* `sha`
* `parentShas` — parent commit SHAs in Git parent order; empty for root commits. Python:
  `parent_shas`; Go: `ParentSHAs`.
* `message`
* `authorName`, `authorEmail`
* `committerName`, `committerEmail`
* `date` (parsed `Date` in TypeScript, `datetime` in Python, `time.Time` in 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.

The `signature`/`payload` pair mirrors GitHub's commit `verification` object, so you can verify a
signature yourself by checking `signature` against `payload`:

```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
const { commit } = await repo.getCommit({ sha: 'abc123def456' });

if (commit.signature) {
  // `commit.payload` is the data the signature was computed over.
  verifyOpenPGP(commit.payload, commit.signature);
}
```

## Notes

* This endpoint does not compute or return the commit diff. Use
  [`getCommitDiff()`](/docs/reference/sdk/get-commit-diff) when you need file changes as well.
* For listing many commits at once, prefer [`listCommits()`](/docs/reference/sdk/list-commits) — the
  per-commit shape is identical except that `signature` and `payload` are only returned by
  `getCommit()`.
* `signature` and `payload` let clients verify commit signatures independently. The server enforces
  signatures at push time through the
  [`verify-sig` branch-protection policy](/docs/guides/branch-protection#commit-signing-verifications).
