]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-notes.txt
notes: implement 'git notes copy --stdin'
[thirdparty/git.git] / Documentation / git-notes.txt
CommitLineData
65d9fb48
JS
1git-notes(1)
2============
3
4NAME
5----
7d541174 6git-notes - Add/inspect object notes
65d9fb48
JS
7
8SYNOPSIS
9--------
10[verse]
e397421a 11'git notes' [list [<object>]]
0691cff7 12'git notes' add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
160baa0d 13'git notes' copy [-f] ( --stdin | <from-object> <to-object> )
0691cff7 14'git notes' append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
aaec9bcf 15'git notes' edit [<object>]
e397421a
JH
16'git notes' show [<object>]
17'git notes' remove [<object>]
18'git notes' prune
19
65d9fb48
JS
20
21DESCRIPTION
22-----------
7d541174
JH
23This command allows you to add/remove notes to/from objects, without
24changing the objects themselves.
65d9fb48 25
7d541174
JH
26A 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
894a9d33
TR
30message, after an unindented line saying "Notes (<refname>):" (or
31"Notes:" for the default setting).
7d541174 32
894a9d33
TR
33This 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.
65d9fb48
JS
37
38
39SUBCOMMANDS
40-----------
41
e397421a
JH
42list::
43 List the notes object for a given object. If no object is
44 given, show a list of all note objects and the objects they
45 annotate (in the format "<note object> <annotated object>").
46 This is the default subcommand if no subcommand is given.
47
7aa4754e
JH
48add::
49 Add notes for a given object (defaults to HEAD). Abort if the
50 object already has notes, abort. (use `-f` to overwrite an
51 existing note).
52
e73bbd96
JH
53copy::
54 Copy the notes for the first object onto the second object.
55 Abort if the second object already has notes, or if the first
56 objects has none. (use -f to overwrite existing notes to the
57 second object). This subcommand is equivalent to:
58 `git notes add [-f] -C $(git notes list <from-object>) <to-object>`
160baa0d
TR
59+
60In `\--stdin` mode, take lines in the format
61+
62----------
63<from-object> SP <to-object> [ SP <rest> ] LF
64----------
65+
66on standard input, and copy the notes from each <from-object> to its
67corresponding <to-object>. (The optional `<rest>` is ignored so that
68the command can read the input given to the `post-rewrite` hook.)
e73bbd96 69
2347fae5
JH
70append::
71 Append to the notes of an existing object (defaults to HEAD).
72 Creates a new notes object if needed.
73
65d9fb48 74edit::
7d541174 75 Edit the notes for a given object (defaults to HEAD).
65d9fb48
JS
76
77show::
7d541174 78 Show the notes for a given object (defaults to HEAD).
65d9fb48 79
92b3385f 80remove::
7d541174 81 Remove the notes for a given object (defaults to HEAD).
92b3385f
JH
82 This is equivalent to specifying an empty note message to
83 the `edit` subcommand.
84
d6576e1f
JH
85prune::
86 Remove all notes for non-existing/unreachable objects.
65d9fb48 87
d9246d43
JH
88OPTIONS
89-------
7aa4754e
JH
90-f::
91--force::
92 When adding notes to an object that already has notes,
93 overwrite the existing notes (instead of aborting).
94
d9246d43 95-m <msg>::
ba20f15e 96--message=<msg>::
d9246d43 97 Use the given note message (instead of prompting).
cd067d3b
JH
98 If multiple `-m` options are given, their values
99 are concatenated as separate paragraphs.
d9246d43
JH
100
101-F <file>::
ba20f15e 102--file=<file>::
d9246d43
JH
103 Take the note message from the given file. Use '-' to
104 read the note message from the standard input.
d9246d43 105
0691cff7
JH
106-C <object>::
107--reuse-message=<object>::
108 Reuse the note message from the given note object.
109
110-c <object>::
111--reedit-message=<object>::
112 Like '-C', but with '-c' the editor is invoked, so that
113 the user can further edit the note message.
d9246d43 114
65d9fb48
JS
115Author
116------
7d541174
JH
117Written by Johannes Schindelin <johannes.schindelin@gmx.de> and
118Johan Herland <johan@herland.net>
65d9fb48
JS
119
120Documentation
121-------------
7d541174 122Documentation by Johannes Schindelin and Johan Herland
65d9fb48
JS
123
124GIT
125---
126Part of the linkgit:git[7] suite