git notes add -m <note-text>

Add a note to the current commit without altering its history

This command lets you attach a custom message to a commit in Git without modifying its history.

It works by creating a note object stored under refs/notes/commits keyed by the commit’s SHA; using -m you supply the note text directly, or you can use -F <file> to load it from a file, and if you skip -m Git will launch your editor.

Once added, you can inspect notes with git log --show-notes or git notes show. Closely related commands include git notes edit to update a note, git notes remove or rm to delete one, and viewing logs with git log --notes; you can also force overwrite with -f, merge notes using git notes merge, or import note content from a file via -F.

Example:

git notes add -m 'Reviewed-by: Alice'
Related commands

Welcome to GitExamples!

Sign in to enable bookmarking, reminders, progress-tracking and more...