Home Explore Blog CI



git

1st chunk of `Documentation/git-notes.adoc`
7f911cb84ce3acbf774017a03e70e9b775d18eab578a00de0000000100000fa4
git-notes(1)
============

NAME
----
git-notes - Add or inspect object notes

SYNOPSIS
--------
[synopsis]
git notes [list [<object>]]
git notes add [-f] [--allow-empty] [--[no-]separator | --separator=<paragraph-break>] [--[no-]stripspace] [-F <file> | -m <msg> | (-c | -C) <object>] [-e] [<object>]
git notes copy [-f] ( --stdin | <from-object> [<to-object>] )
git notes append [--allow-empty] [--[no-]separator | --separator=<paragraph-break>] [--[no-]stripspace] [-F <file> | -m <msg> | (-c | -C) <object>] [-e] [<object>]
git notes edit [--allow-empty] [<object>] [--[no-]stripspace]
git notes show [<object>]
git notes merge [-v | -q] [-s <strategy> ] <notes-ref>
git notes merge --commit [-v | -q]
git notes merge --abort [-v | -q]
git notes remove [--ignore-missing] [--stdin] [<object>...]
git notes prune [-n] [-v]
git notes get-ref


DESCRIPTION
-----------
Adds, removes, or reads notes attached to objects, without touching
the objects themselves.

By default, notes are saved to and read from `refs/notes/commits`, but
this default can be overridden.  See the OPTIONS, CONFIGURATION, and
ENVIRONMENT sections below.  If this ref does not exist, it will be
quietly created when it is first needed to store a note.

A typical use of notes is to supplement a commit message without
changing the commit itself. Notes can be shown by `git log` along with
the original commit message. To distinguish these notes from the
message stored in the commit object, the notes are indented like the
message, after an unindented line saying "Notes (_<refname>_):" (or
"Notes:" for `refs/notes/commits`).

Notes can also be added to patches prepared with `git format-patch` by
using the `--notes` option. Such notes are added as a patch commentary
after a three dash separator line.

To change which notes are shown by `git log`, see the
`notes.displayRef` discussion in <<CONFIGURATION,CONFIGURATION>>.

See the `notes.rewrite.<command>` configuration for a way to carry
notes across commands that rewrite commits.


SUBCOMMANDS
-----------

`list`::
	List the notes object for a given object. If no object is
	given, show a list of all note objects and the objects they
	annotate (in the format "`<note-object> <annotated-object>`").
	This is the default subcommand if no subcommand is given.

`add`::
	Add notes for a given object (defaults to `HEAD`). Abort if the
	object already has notes (use `-f` to overwrite existing notes).
	However, if you're using `add` interactively (using an editor
	to supply the notes contents), then - instead of aborting -
	the existing notes will be opened in the editor (like the `edit`
	subcommand). If you specify multiple `-m` and `-F`, a blank
	line will be inserted between the messages. Use the `--separator`
	option to insert other delimiters. You can use `-e` to edit and
	fine-tune the message(s) supplied from `-m` and `-F` options
	interactively (using an editor) before adding the note.

`copy`::
	Copy the notes for the first object onto the second object (defaults to
	`HEAD`). Abort if the second object already has notes, or if the first
	object has none (use `-f` to overwrite existing notes to the
	second object). This subcommand is equivalent to:
	`git notes add [-f] -C $(git notes list <from-object>) <to-object>`
+
In `--stdin` mode, take lines in the format
+
----------
<from-object> SP <to-object> [ SP <rest> ] LF
----------
+
on standard input, and copy the notes from each _<from-object>_ to its
corresponding _<to-object>_.  (The optional _<rest>_ is ignored so that
the command can read the input given to the `post-rewrite` hook.)
+
`--stdin` cannot be combined with object names given on the command
line.

`append`::
	Append new message(s) given by `-m` or `-F` options to an
	existing note, or add them as a new note if one does not
	exist, for the object (defaults to `HEAD`).  When appending to
	an existing note, a blank line is added before each new
	message as an inter-paragraph separator.  The separator can
	be customized with

Title: Git Notes Documentation
Summary
The git-notes command is used to add, remove, or read notes attached to objects in a Git repository, allowing users to supplement commit messages without modifying the commits themselves. It provides various subcommands, including list, add, copy, append, edit, show, merge, remove, and prune, each serving a specific purpose in managing notes. Notes can be displayed alongside commit messages using git log, and can also be added to patches prepared with git format-patch. The command offers flexibility and customization options, such as specifying the notes reference, configuring display settings, and rewriting notes across commands that modify commits.