blob: 4e5113b837230c8f050cf4bbe10e8de4b3271bd0 [file] [log] [blame]
Junio C Hamano3b70d3c2009-11-21 17:37:371git-notes(1)
2============
3
4NAME
5----
Junio C Hamanoea90ab32010-03-15 20:32:556git-notes - Add/inspect object notes
Junio C Hamano3b70d3c2009-11-21 17:37:377
8SYNOPSIS
9--------
10[verse]
Junio C Hamanoea90ab32010-03-15 20:32:5511'git notes' [list [<object>]]
12'git notes' add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
Junio C Hamano31667362010-03-25 00:38:5313'git notes' copy [-f] ( --stdin | <from-object> <to-object> )
Junio C Hamanoea90ab32010-03-15 20:32:5514'git notes' append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
15'git notes' edit [<object>]
16'git notes' show [<object>]
17'git notes' remove [<object>]
18'git notes' prune
19
Junio C Hamano3b70d3c2009-11-21 17:37:3720
21DESCRIPTION
22-----------
Junio C Hamanoea90ab32010-03-15 20:32:5523This command allows you to add/remove notes to/from objects, without
24changing the objects themselves.
Junio C Hamano3b70d3c2009-11-21 17:37:3725
Junio C Hamanoea90ab32010-03-15 20:32:5526A typical use of notes is to extend a commit message without having
27to change the commit itself. Such commit notes can be shown by `git log`
28along with the original commit message. To discern these notes from the
29message stored in the commit object, the notes are indented like the
Junio C Hamano31667362010-03-25 00:38:5330message, after an unindented line saying "Notes (<refname>):" (or
31"Notes:" for the default setting).
Junio C Hamanoea90ab32010-03-15 20:32:5532
Junio C Hamano31667362010-03-25 00:38:5333This command always manipulates the notes specified in "core.notesRef"
34(see linkgit:git-config[1]), which can be overridden by GIT_NOTES_REF.
35To change which notes are shown by 'git-log', see the
36"notes.displayRef" configuration.
37
38See the description of "notes.rewrite.<command>" in
39linkgit:git-config[1] for a way of carrying your notes across commands
40that rewrite commits.
Junio C Hamano3b70d3c2009-11-21 17:37:3741
42
43SUBCOMMANDS
44-----------
45
Junio C Hamanoea90ab32010-03-15 20:32:5546list::
47List the notes object for a given object. If no object is
48given, show a list of all note objects and the objects they
49annotate (in the format "<note object> <annotated object>").
50This is the default subcommand if no subcommand is given.
51
52add::
53Add notes for a given object (defaults to HEAD). Abort if the
54object already has notes (use `-f` to overwrite an
55existing note).
56
57copy::
58Copy the notes for the first object onto the second object.
59Abort if the second object already has notes, or if the first
60object has none (use -f to overwrite existing notes to the
61second object). This subcommand is equivalent to:
62`git notes add [-f] -C $(git notes list <from-object>) <to-object>`
Junio C Hamano31667362010-03-25 00:38:5363+
64In `\--stdin` mode, take lines in the format
65+
66----------
67<from-object> SP <to-object> [ SP <rest> ] LF
68----------
69+
70on standard input, and copy the notes from each <from-object> to its
71corresponding <to-object>. (The optional `<rest>` is ignored so that
72the command can read the input given to the `post-rewrite` hook.)
Junio C Hamanoea90ab32010-03-15 20:32:5573
74append::
75Append to the notes of an existing object (defaults to HEAD).
76Creates a new notes object if needed.
77
Junio C Hamano3b70d3c2009-11-21 17:37:3778edit::
Junio C Hamanoea90ab32010-03-15 20:32:5579Edit the notes for a given object (defaults to HEAD).
Junio C Hamano3b70d3c2009-11-21 17:37:3780
81show::
Junio C Hamanoea90ab32010-03-15 20:32:5582Show the notes for a given object (defaults to HEAD).
Junio C Hamano3b70d3c2009-11-21 17:37:3783
Junio C Hamanoea90ab32010-03-15 20:32:5584remove::
85Remove the notes for a given object (defaults to HEAD).
86This is equivalent to specifying an empty note message to
87the `edit` subcommand.
88
89prune::
90Remove all notes for non-existing/unreachable objects.
Junio C Hamano3b70d3c2009-11-21 17:37:3791
92OPTIONS
93-------
Junio C Hamanoea90ab32010-03-15 20:32:5594-f::
95--force::
96When adding notes to an object that already has notes,
97overwrite the existing notes (instead of aborting).
98
Junio C Hamano3b70d3c2009-11-21 17:37:3799-m <msg>::
Junio C Hamanoea90ab32010-03-15 20:32:55100--message=<msg>::
Junio C Hamano3b70d3c2009-11-21 17:37:37101Use the given note message (instead of prompting).
Junio C Hamanoea90ab32010-03-15 20:32:55102If multiple `-m` options are given, their values
103are concatenated as separate paragraphs.
Junio C Hamano3b70d3c2009-11-21 17:37:37104
105-F <file>::
Junio C Hamanoea90ab32010-03-15 20:32:55106--file=<file>::
Junio C Hamano3b70d3c2009-11-21 17:37:37107Take the note message from the given file. Use '-' to
108read the note message from the standard input.
Junio C Hamano3b70d3c2009-11-21 17:37:37109
Junio C Hamanoea90ab32010-03-15 20:32:55110-C <object>::
111--reuse-message=<object>::
112Reuse the note message from the given note object.
113
114-c <object>::
115--reedit-message=<object>::
116Like '-C', but with '-c' the editor is invoked, so that
117the user can further edit the note message.
Junio C Hamano3b70d3c2009-11-21 17:37:37118
Junio C Hamano31667362010-03-25 00:38:53119--ref <ref>::
120Manipulate the notes tree in <ref>. This overrides both
121GIT_NOTES_REF and the "core.notesRef" configuration. The ref
122is taken to be in `refs/notes/` if it is not qualified.
123
124
125NOTES
126-----
127
128Every notes change creates a new commit at the specified notes ref.
129You can therefore inspect the history of the notes by invoking, e.g.,
130`git log -p notes/commits`.
131
132Currently the commit message only records which operation triggered
133the update, and the commit authorship is determined according to the
134usual rules (see linkgit:git-commit[1]). These details may change in
135the future.
136
137
Junio C Hamano3b70d3c2009-11-21 17:37:37138Author
139------
Junio C Hamanoea90ab32010-03-15 20:32:55140Written by Johannes Schindelin <johannes.schindelin@gmx.de> and
141Johan Herland <johan@herland.net>
Junio C Hamano3b70d3c2009-11-21 17:37:37142
143Documentation
144-------------
Junio C Hamanoea90ab32010-03-15 20:32:55145Documentation by Johannes Schindelin and Johan Herland
Junio C Hamano3b70d3c2009-11-21 17:37:37146
147GIT
148---
149Part of the linkgit:git[7] suite