]> git.ipfire.org Git - thirdparty/git.git/blob - Documentation/git-notes.txt
notes: implement 'git notes copy --stdin'
[thirdparty/git.git] / Documentation / git-notes.txt
1 git-notes(1)
2 ============
3
4 NAME
5 ----
6 git-notes - Add/inspect object notes
7
8 SYNOPSIS
9 --------
10 [verse]
11 'git notes' [list [<object>]]
12 'git notes' add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
13 'git notes' copy [-f] ( --stdin | <from-object> <to-object> )
14 '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
20
21 DESCRIPTION
22 -----------
23 This command allows you to add/remove notes to/from objects, without
24 changing the objects themselves.
25
26 A typical use of notes is to extend a commit message without having
27 to change the commit itself. Such commit notes can be shown by `git log`
28 along with the original commit message. To discern these notes from the
29 message stored in the commit object, the notes are indented like the
30 message, after an unindented line saying "Notes (<refname>):" (or
31 "Notes:" for the default setting).
32
33 This command always manipulates the notes specified in "core.notesRef"
34 (see linkgit:git-config[1]), which can be overridden by GIT_NOTES_REF.
35 To change which notes are shown by 'git-log', see the
36 "notes.displayRef" configuration.
37
38
39 SUBCOMMANDS
40 -----------
41
42 list::
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
48 add::
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
53 copy::
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>`
59 +
60 In `\--stdin` mode, take lines in the format
61 +
62 ----------
63 <from-object> SP <to-object> [ SP <rest> ] LF
64 ----------
65 +
66 on standard input, and copy the notes from each <from-object> to its
67 corresponding <to-object>. (The optional `<rest>` is ignored so that
68 the command can read the input given to the `post-rewrite` hook.)
69
70 append::
71 Append to the notes of an existing object (defaults to HEAD).
72 Creates a new notes object if needed.
73
74 edit::
75 Edit the notes for a given object (defaults to HEAD).
76
77 show::
78 Show the notes for a given object (defaults to HEAD).
79
80 remove::
81 Remove the notes for a given object (defaults to HEAD).
82 This is equivalent to specifying an empty note message to
83 the `edit` subcommand.
84
85 prune::
86 Remove all notes for non-existing/unreachable objects.
87
88 OPTIONS
89 -------
90 -f::
91 --force::
92 When adding notes to an object that already has notes,
93 overwrite the existing notes (instead of aborting).
94
95 -m <msg>::
96 --message=<msg>::
97 Use the given note message (instead of prompting).
98 If multiple `-m` options are given, their values
99 are concatenated as separate paragraphs.
100
101 -F <file>::
102 --file=<file>::
103 Take the note message from the given file. Use '-' to
104 read the note message from the standard input.
105
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.
114
115 Author
116 ------
117 Written by Johannes Schindelin <johannes.schindelin@gmx.de> and
118 Johan Herland <johan@herland.net>
119
120 Documentation
121 -------------
122 Documentation by Johannes Schindelin and Johan Herland
123
124 GIT
125 ---
126 Part of the linkgit:git[7] suite