LinuxCommandLibrary

git-notes

Add metadata to commits

TLDR

Add note to commit

$ git notes add -m "[note text]"
copy
Add note to specific commit
$ git notes add -m "[note]" [commit]
copy
Show notes
$ git notes show
copy
Edit existing note
$ git notes edit [commit]
copy
Remove note
$ git notes remove [commit]
copy

SYNOPSIS

git notes [command] [options]

DESCRIPTION

git notes adds metadata to commits without modifying them. Notes are stored as separate refs, allowing annotations, code review comments, 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.

PARAMETERS

add

Add note to object.
show
Show notes.
edit
Edit existing note.
remove
Remove note.
list
List notes.
-m MSG
Note message.
--ref REF
Notes ref to use.
--help
Display help information.

CAVEATS

Notes are separate refs. Not pushed by default. May need explicit fetch/push.

HISTORY

git notes was added to Git to allow adding metadata to commits without rewriting history, useful for review systems and annotations.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community