git-notes
Add metadata to commits
TLDR
SYNOPSIS
git notes [subcommand] [options]
DESCRIPTION
git notes adds metadata to commits without modifying them. Notes are stored as separate refs under refs/notes/, allowing annotations, code review comments, build status, or other metadata to be attached after commits are created and even after they have been pushed.Notes can be organized in namespaces using the --ref option. Since notes don't change commit hashes, they provide a non-destructive way to enrich commit history with additional context.The default notes ref is refs/notes/commits, but you can keep separate notes namespaces (e.g. refs/notes/review, refs/notes/build) by using --ref or by setting core.notesRef in git config.
PARAMETERS
add
Add a new note to the given object (default: HEAD). Fails if a note already exists unless -f is used.show
Print the note for the given object.list
List notes for the given object, or list all notes if no object is specified.edit
Edit existing note in the configured editor.append
Append new content to an existing note.copy from to
Copy the note from one object to another.remove
Remove notes for the given objects.prune
Remove notes attached to objects that no longer exist.merge ref
Merge notes from another notes ref.get-ref
Print the current notes ref.-m MSG
Use given message as the note text.-F FILE
Read note text from a file.-C OBJECT
Reuse note from given object.-c OBJECT
Reuse and edit note from given object.-f, --force
Overwrite an existing note.--ref REF
Use the given notes ref instead of the default refs/notes/commits.
CAVEATS
Notes are stored as separate refs and are not pushed or fetched by default. Use explicit refspecs like **refs/notes/*:refs/notes/*** to sync notes between repositories. Concurrent edits can cause notes-merge conflicts.
HISTORY
git notes was added to Git in version 1.6.6 (December 2009) to allow attaching metadata to commits without rewriting history.
SEE ALSO
git-log(1), git-commit(1), git-push(1), git-fetch(1)
