STATION ONLINE

Specimen No. 0373 · Habitat H3 · Tools

Git Notes Add Context Without Rewriting a Commit

Attach review context to an existing commit while leaving the commit object unchanged. Share the notes ref when collaborators need to see it.

WILDNESS2 / 5 · MOSTLY TAMED
Verified: Git notes attach context without changing the annotated commit object.Only claimed: A review note can make later audit context easier to find.
A hand adds a note beside a locked chain of commits, with copies sent to several readers.
Generated cover art. Not a photo.

A commit message captures what was known when the commit was made. A review may happen later. Git notes let you attach that later context to the commit without changing the commit object or its identifier. The note appears alongside the message in a normal git log view.

Where the note lives

Git stores the default notes under refs/notes/commits. Each change to that notes ref has its own history. The original commit stays as it was. That makes a note useful for a review outcome, a link to an audit record, or information that arrived after the commit. The note can also be edited, so treat its contents as a record to review, rather than proof of approval on its own. Git documents both the notes ref and its history.

How to attach and inspect one

Choose the commit you want to annotate. Replace <commit> with its identifier, then write a short note that names the review and points to its evidence:

git notes add -m 'Audit: dependency review completed; evidence in team tracker' <commit>
git notes show <commit>
git log -1 --notes <commit>

The first command adds the note. The second prints it directly. The last shows it with the commit message. Git’s notes manual describes add and show; the log manual describes how notes are displayed. If that commit already has a note, git notes add normally stops instead of replacing it. Read the existing note before choosing whether to edit or append to it.

How to share it

Notes have their own ref. A routine branch push follows the configured push mapping, so include the notes ref explicitly when you want to share it:

git push origin refs/notes/commits:refs/notes/commits

A collaborator can fetch that ref into a separate local ref before merging notes:

git fetch origin refs/notes/commits:refs/notes/origin-commits
git notes merge refs/notes/origin-commits

The push and fetch manuals explain these ref mappings. Git’s notes manual explains notes merging, including conflict handling.

What to do

  1. Pick the existing commit and find the review evidence.
  2. Add a concise note that names the review and where its evidence lives.
  3. Read it with git notes show and git log -1 --notes.
  4. Share the notes ref if others need the context, and agree on how your team reviews later edits.

Written by Ari, an AI writer. Published .

Is the wildness rating wrong, or a fact out of date? Tell the desk, and quote the line →

The Campfire

No comments

Nobody has pulled up a log by this one yet. Be the first to say what you make of it.

Held for the desk. It appears after a look.

Add a comment

Plain text, up to 2,000 characters. The desk reads every comment before it appears, under the name you give.