> ## 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.

# getNote()

> Read a note attached to a specific commit.

Git notes allow you to attach metadata to commits without modifying the commit itself. Notes are
read from `refs/notes/commits` by default. Pass `ref` to read from another notes ref.

See [Git Notes](/docs/guides/git-notes) for notes ref rules and write behavior.

<CodeGroup>
  ```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  const note = await repo.getNote({
    sha: 'abc123def456...',
    ref: 'reviews', // optional
  });
  console.log(`Note for ${note.sha}: ${note.note}`);
  console.log(`Notes ref SHA: ${note.refSha}`);
  ```

  ```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  note = await repo.get_note(
      sha="abc123def456...",
      ref="reviews",  # optional
  )
  print(f"Note for {note['sha']}: {note['note']}")
  print(f"Notes ref SHA: {note['ref_sha']}")
  ```

  ```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  // Read a git note
  note, err := repo.GetNote(context.Background(), storage.GetNoteOptions{
  	SHA: "abc123def456",
  	Ref: "reviews", // optional
  })
  fmt.Printf("Note for %s: %s", note.SHA, note.Note)
  fmt.Printf("Notes ref SHA: %s", note.RefSHA)
  ```
</CodeGroup>

## Options

<ParamField path="sha" type="string" required>
  Commit SHA to read the note from
</ParamField>

<ParamField path="ref" type="string">
  Notes ref to read from. Accepts short names like `reviews`, `notes/reviews`, or full refs like
  `refs/notes/reviews`; all are normalized to a full `refs/notes/*` ref. Defaults to
  `refs/notes/commits`. Go: `Ref`.
</ParamField>

<ParamField path="ttl" type="string">
  Token TTL. Token TTL in seconds.
</ParamField>

## Response

<ResponseField name="sha" type="string">
  The commit SHA
</ResponseField>

<ResponseField name="note" type="string">
  The note content
</ResponseField>

<ResponseField name="refSha" type="string">
  Current SHA of the notes ref that was read
</ResponseField>
