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

# repo.getNote()

> Read a note attached to a specific commit.

> [!WARNING]
>
> This page documents the earlier Code Storage SDKs: `@pierre/storage`, `pierre-storage`, and
> `code-storage-go`. New code uses the [Pierre SDK](https://code.storage/docs/sdks.md). To move code to the new SDK, use the
> [`pierre-migrate`
> skill](https://github.com/pierrecomputer/skills/tree/main/skills/pierre-migrate).

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](https://code.storage/docs/repos/git-notes.md) for notes ref rules and write behavior.

```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)
```

## Options

**sha** `string` *required*

Commit SHA to read the note from

**ref** `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`.

**ttl** `string`

Token TTL. Token TTL in seconds.

## Response

**sha** `string`

The commit SHA

**note** `string`

The note content

**refSha** `string`

Current SHA of the notes ref that was read


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.