logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-notes.1 (21261B)


  1. '\" t
  2. .\" Title: git-notes
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-NOTES" "1" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-notes \- Add or inspect object notes
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fBgit\fR \fBnotes\fR [\fBlist\fR [\fI<object>\fR]]
  36. \fBgit\fR \fBnotes\fR \fBadd\fR [\fB\-f\fR] [\fB\-\-allow\-empty\fR] [\fB\-\-\fR[\fBno\-\fR]\fBseparator\fR | \fB\-\-separator=\fR\fI<paragraph\-break>\fR] [\fB\-\-\fR[\fBno\-\fR]\fBstripspace\fR] [\fB\-F\fR \fI<file>\fR | \fB\-m\fR \fI<msg>\fR | (\fB\-c\fR | \fB\-C\fR) \fI<object>\fR] [\fB\-e\fR] [\fI<object>\fR]
  37. \fBgit\fR \fBnotes\fR \fBcopy\fR [\fB\-f\fR] ( \fB\-\-stdin\fR | \fI<from\-object>\fR [\fI<to\-object>\fR] )
  38. \fBgit\fR \fBnotes\fR \fBappend\fR [\fB\-\-allow\-empty\fR] [\fB\-\-\fR[\fBno\-\fR]\fBseparator\fR | \fB\-\-separator=\fR\fI<paragraph\-break>\fR] [\fB\-\-\fR[\fBno\-\fR]\fBstripspace\fR] [\fB\-F\fR \fI<file>\fR | \fB\-m\fR \fI<msg>\fR | (\fB\-c\fR | \fB\-C\fR) \fI<object>\fR] [\fB\-e\fR] [\fI<object>\fR]
  39. \fBgit\fR \fBnotes\fR \fBedit\fR [\fB\-\-allow\-empty\fR] [\fI<object>\fR] [\fB\-\-\fR[\fBno\-\fR]\fBstripspace\fR]
  40. \fBgit\fR \fBnotes\fR \fBshow\fR [\fI<object>\fR]
  41. \fBgit\fR \fBnotes\fR \fBmerge\fR [\fB\-v\fR | \fB\-q\fR] [\fB\-s\fR \fI<strategy>\fR ] \fI<notes\-ref>\fR
  42. \fBgit\fR \fBnotes\fR \fBmerge\fR \fB\-\-commit\fR [\fB\-v\fR | \fB\-q\fR]
  43. \fBgit\fR \fBnotes\fR \fBmerge\fR \fB\-\-abort\fR [\fB\-v\fR | \fB\-q\fR]
  44. \fBgit\fR \fBnotes\fR \fBremove\fR [\fB\-\-ignore\-missing\fR] [\fB\-\-stdin\fR] [\fI<object>\fR\&...\:]
  45. \fBgit\fR \fBnotes\fR \fBprune\fR [\fB\-n\fR] [\fB\-v\fR]
  46. \fBgit\fR \fBnotes\fR \fBget\-ref\fR
  47. .fi
  48. .SH "DESCRIPTION"
  49. .sp
  50. Adds, removes, or reads notes attached to objects, without touching the objects themselves\&.
  51. .sp
  52. By default, notes are saved to and read from \fBrefs/notes/commits\fR, 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\&.
  53. .sp
  54. A typical use of notes is to supplement a commit message without changing the commit itself\&. Notes can be shown by \fBgit\fR \fBlog\fR 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 (\fI<refname>\fR):" (or "Notes:" for \fBrefs/notes/commits\fR)\&.
  55. .sp
  56. Notes can also be added to patches prepared with \fBgit\fR \fBformat\-patch\fR by using the \fB\-\-notes\fR option\&. Such notes are added as a patch commentary after a three dash separator line\&.
  57. .sp
  58. To change which notes are shown by \fBgit\fR \fBlog\fR, see the \fBnotes\&.displayRef\fR discussion in CONFIGURATION\&.
  59. .sp
  60. See the \fBnotes\&.rewrite\&.\fR\fI<command>\fR configuration for a way to carry notes across commands that rewrite commits\&.
  61. .SH "SUBCOMMANDS"
  62. .PP
  63. \fBlist\fR
  64. .RS 4
  65. 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 "\fI<note\-object>\fR
  66. \fI<annotated\-object>\fR")\&. This is the default subcommand if no subcommand is given\&.
  67. .RE
  68. .PP
  69. \fBadd\fR
  70. .RS 4
  71. Add notes for a given object (defaults to
  72. \fBHEAD\fR)\&. Abort if the object already has notes (use
  73. \fB\-f\fR
  74. to overwrite existing notes)\&. However, if you\(cqre using
  75. \fBadd\fR
  76. interactively (using an editor to supply the notes contents), then \- instead of aborting \- the existing notes will be opened in the editor (like the
  77. \fBedit\fR
  78. subcommand)\&. If you specify multiple
  79. \fB\-m\fR
  80. and
  81. \fB\-F\fR, a blank line will be inserted between the messages\&. Use the
  82. \fB\-\-separator\fR
  83. option to insert other delimiters\&. You can use
  84. \fB\-e\fR
  85. to edit and fine\-tune the message(s) supplied from
  86. \fB\-m\fR
  87. and
  88. \fB\-F\fR
  89. options interactively (using an editor) before adding the note\&.
  90. .RE
  91. .PP
  92. \fBcopy\fR
  93. .RS 4
  94. Copy the notes for the first object onto the second object (defaults to
  95. \fBHEAD\fR)\&. Abort if the second object already has notes, or if the first object has none (use
  96. \fB\-f\fR
  97. to overwrite existing notes to the second object)\&. This subcommand is equivalent to:
  98. \fBgit\fR
  99. \fBnotes\fR
  100. \fBadd\fR
  101. [\fB\-f\fR]
  102. \fB\-C\fR
  103. \fB$\fR(\fBgit\fR
  104. \fBnotes\fR
  105. \fBlist\fR
  106. \fI<from\-object>\fR)
  107. \fI<to\-object>\fR
  108. .sp
  109. In
  110. \fB\-\-stdin\fR
  111. mode, take lines in the format
  112. .sp
  113. .if n \{\
  114. .RS 4
  115. .\}
  116. .nf
  117. <from\-object> SP <to\-object> [ SP <rest> ] LF
  118. .fi
  119. .if n \{\
  120. .RE
  121. .\}
  122. .sp
  123. on standard input, and copy the notes from each
  124. \fI<from\-object>\fR
  125. to its corresponding
  126. \fI<to\-object>\fR\&. (The optional
  127. \fI<rest>\fR
  128. is ignored so that the command can read the input given to the
  129. \fBpost\-rewrite\fR
  130. hook\&.)
  131. .RE
  132. .PP
  133. \fBappend\fR
  134. .RS 4
  135. Append new message(s) given by
  136. \fB\-m\fR
  137. or
  138. \fB\-F\fR
  139. options to an existing note, or add them as a new note if one does not exist, for the object (defaults to
  140. \fBHEAD\fR)\&. 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 the
  141. \fB\-\-separator\fR
  142. option\&. Edit the notes to be appended given by
  143. \fB\-m\fR
  144. and
  145. \fB\-F\fR
  146. options with
  147. \fB\-e\fR
  148. interactively (using an editor) before appending the note\&.
  149. .RE
  150. .PP
  151. \fBedit\fR
  152. .RS 4
  153. Edit the notes for a given object (defaults to
  154. \fBHEAD\fR)\&.
  155. .RE
  156. .PP
  157. \fBshow\fR
  158. .RS 4
  159. Show the notes for a given object (defaults to
  160. \fBHEAD\fR)\&.
  161. .RE
  162. .PP
  163. \fBmerge\fR
  164. .RS 4
  165. Merge the given notes ref into the current notes ref\&. This will try to merge the changes made by the given notes ref (called "remote") since the merge\-base (if any) into the current notes ref (called "local")\&.
  166. .sp
  167. If conflicts arise and a strategy for automatically resolving conflicting notes (see the "NOTES MERGE STRATEGIES" section) is not given, the
  168. \fBmanual\fR
  169. resolver is used\&. This resolver checks out the conflicting notes in a special worktree (\&.\fBgit/NOTES_MERGE_WORKTREE\fR), and instructs the user to manually resolve the conflicts there\&. When done, the user can either finalize the merge with
  170. \fBgit\fR
  171. \fBnotes\fR
  172. \fBmerge\fR
  173. \fB\-\-commit\fR, or abort the merge with
  174. \fBgit\fR
  175. \fBnotes\fR
  176. \fBmerge\fR
  177. \fB\-\-abort\fR\&.
  178. .RE
  179. .PP
  180. \fBremove\fR
  181. .RS 4
  182. Remove the notes for given objects (defaults to
  183. \fBHEAD\fR)\&. When giving zero or one object from the command line, this is equivalent to specifying an empty note message to the
  184. \fBedit\fR
  185. subcommand\&.
  186. .RE
  187. .PP
  188. \fBprune\fR
  189. .RS 4
  190. Remove all notes for non\-existing/unreachable objects\&.
  191. .RE
  192. .PP
  193. \fBget\-ref\fR
  194. .RS 4
  195. Print the current notes ref\&. This provides an easy way to retrieve the current notes ref (e\&.g\&. from scripts)\&.
  196. .RE
  197. .SH "OPTIONS"
  198. .PP
  199. \fB\-f\fR, \fB\-\-force\fR
  200. .RS 4
  201. When adding notes to an object that already has notes, overwrite the existing notes (instead of aborting)\&.
  202. .RE
  203. .PP
  204. \fB\-m\fR \fI<msg>\fR, \fB\-\-message=\fR\fI<msg>\fR
  205. .RS 4
  206. Use the given note message (instead of prompting)\&. If multiple
  207. \fB\-m\fR
  208. options are given, their values are concatenated as separate paragraphs\&. Lines starting with # and empty lines other than a single line between paragraphs will be stripped out\&. If you wish to keep them verbatim, use
  209. \fB\-\-no\-stripspace\fR\&.
  210. .RE
  211. .PP
  212. \fB\-F\fR \fI<file>\fR, \fB\-\-file=\fR\fI<file>\fR
  213. .RS 4
  214. Take the note message from the given file\&. Use
  215. \fB\-\fR
  216. to read the note message from the standard input\&. Lines starting with # and empty lines other than a single line between paragraphs will be stripped out\&. If you wish to keep them verbatim, use
  217. \fB\-\-no\-stripspace\fR\&.
  218. .RE
  219. .PP
  220. \fB\-C\fR \fI<object>\fR, \fB\-\-reuse\-message=\fR\fI<object>\fR
  221. .RS 4
  222. Take the given blob object (for example, another note) as the note message\&. (Use
  223. \fBgit\fR
  224. \fBnotes\fR
  225. \fBcopy\fR
  226. \fI<object>\fR
  227. instead to copy notes between objects\&.)\&. By default, message will be copied verbatim, but if you wish to strip out the lines starting with # and empty lines other than a single line between paragraphs, use with
  228. \fB\-\-stripspace\fR
  229. option\&.
  230. .RE
  231. .PP
  232. \fB\-c\fR \fI<object>\fR, \fB\-\-reedit\-message=\fR\fI<object>\fR
  233. .RS 4
  234. Like
  235. \fB\-C\fR, but with
  236. \fB\-c\fR
  237. the editor is invoked, so that the user can further edit the note message\&.
  238. .RE
  239. .PP
  240. \fB\-\-allow\-empty\fR
  241. .RS 4
  242. Allow an empty note object to be stored\&. The default behavior is to automatically remove empty notes\&.
  243. .RE
  244. .PP
  245. \fB\-\-\fR[\fBno\-\fR]\fBseparator\fR, \fB\-\-separator=\fR\fI<paragraph\-break>\fR
  246. .RS 4
  247. Specify a string used as a custom inter\-paragraph separator (a newline is added at the end as needed)\&. If
  248. \fB\-\-no\-separator\fR, no separators will be added between paragraphs\&. Defaults to a blank line\&.
  249. .RE
  250. .PP
  251. \fB\-\-\fR[\fBno\-\fR]\fBstripspace\fR
  252. .RS 4
  253. Strip leading and trailing whitespace from the note message\&. Also strip out empty lines other than a single line between paragraphs\&. Lines starting with # will be stripped out in non\-editor cases like
  254. \fB\-m\fR,
  255. \fB\-F\fR
  256. and
  257. \fB\-C\fR, but not in editor case like
  258. \fBgit\fR
  259. \fBnotes\fR
  260. \fBedit\fR,
  261. \fB\-c\fR, etc\&.
  262. .RE
  263. .PP
  264. \fB\-\-ref\fR \fI<ref>\fR
  265. .RS 4
  266. Manipulate the notes tree in
  267. \fI<ref>\fR\&. This overrides
  268. \fBGIT_NOTES_REF\fR
  269. and the
  270. \fBcore\&.notesRef\fR
  271. configuration\&. The ref specifies the full refname when it begins with
  272. \fBrefs/notes/\fR; when it begins with
  273. \fBnotes/\fR,
  274. \fBrefs/\fR
  275. and otherwise
  276. \fBrefs/notes/\fR
  277. is prefixed to form a full name of the ref\&.
  278. .RE
  279. .PP
  280. \fB\-\-ignore\-missing\fR
  281. .RS 4
  282. Do not consider it an error to request removing notes from an object that does not have notes attached to it\&.
  283. .RE
  284. .PP
  285. \fB\-\-stdin\fR
  286. .RS 4
  287. Also read the object names to remove notes from the standard input (there is no reason you cannot combine this with object names from the command line)\&.
  288. .RE
  289. .PP
  290. \fB\-n\fR, \fB\-\-dry\-run\fR
  291. .RS 4
  292. Do not remove anything; just report the object names whose notes would be removed\&.
  293. .RE
  294. .PP
  295. \fB\-s\fR \fI<strategy>\fR, \fB\-\-strategy=\fR\fI<strategy>\fR
  296. .RS 4
  297. When merging notes, resolve notes conflicts using the given strategy\&. The following strategies are recognized:
  298. \fBmanual\fR
  299. (default),
  300. \fBours\fR,
  301. \fBtheirs\fR,
  302. \fBunion\fR
  303. and
  304. \fBcat_sort_uniq\fR\&. This option overrides the
  305. \fBnotes\&.mergeStrategy\fR
  306. configuration setting\&. See the "NOTES MERGE STRATEGIES" section below for more information on each notes merge strategy\&.
  307. .RE
  308. .PP
  309. \fB\-\-commit\fR
  310. .RS 4
  311. Finalize an in\-progress
  312. \fBgit\fR
  313. \fBnotes\fR
  314. \fBmerge\fR\&. Use this option when you have resolved the conflicts that
  315. \fBgit\fR
  316. \fBnotes\fR
  317. \fBmerge\fR
  318. stored in \&.\fBgit/NOTES_MERGE_WORKTREE\fR\&. This amends the partial merge commit created by
  319. \fBgit\fR
  320. \fBnotes\fR
  321. \fBmerge\fR
  322. (stored in \&.\fBgit/NOTES_MERGE_PARTIAL\fR) by adding the notes in \&.\fBgit/NOTES_MERGE_WORKTREE\fR\&. The notes ref stored in the \&.\fBgit/NOTES_MERGE_REF\fR
  323. symref is updated to the resulting commit\&.
  324. .RE
  325. .PP
  326. \fB\-\-abort\fR
  327. .RS 4
  328. Abort/reset an in\-progress
  329. \fBgit\fR
  330. \fBnotes\fR
  331. \fBmerge\fR, i\&.e\&. a notes merge with conflicts\&. This simply removes all files related to the notes merge\&.
  332. .RE
  333. .PP
  334. \fB\-q\fR, \fB\-\-quiet\fR
  335. .RS 4
  336. When merging notes, operate quietly\&.
  337. .RE
  338. .PP
  339. \fB\-v\fR, \fB\-\-verbose\fR
  340. .RS 4
  341. When merging notes, be more verbose\&. When pruning notes, report all object names whose notes are removed\&.
  342. .RE
  343. .SH "DISCUSSION"
  344. .sp
  345. Commit notes are blobs containing extra information about an object (usually information to supplement a commit\(cqs message)\&. These blobs are taken from notes refs\&. A notes ref is usually a branch which contains "files" whose paths are the object names for the objects they describe, with some directory separators included for performance reasons \&\s-2\u[1]\d\s+2\&.
  346. .sp
  347. Every notes change creates a new commit at the specified notes ref\&. You can therefore inspect the history of the notes by invoking, e\&.g\&., \fBgit\fR \fBlog\fR \fB\-p\fR \fBnotes/commits\fR\&. Currently the commit message only records which operation triggered the update, and the commit authorship is determined according to the usual rules (see \fBgit-commit\fR(1))\&. These details may change in the future\&.
  348. .sp
  349. It is also permitted for a notes ref to point directly to a tree object, in which case the history of the notes can be read with \fBgit\fR \fBlog\fR \fB\-p\fR \fB\-g\fR \fI<refname>\fR\&.
  350. .SH "NOTES MERGE STRATEGIES"
  351. .sp
  352. The default notes merge strategy is \fBmanual\fR, which checks out conflicting notes in a special work tree for resolving notes conflicts (\&.\fBgit/NOTES_MERGE_WORKTREE\fR), and instructs the user to resolve the conflicts in that work tree\&. When done, the user can either finalize the merge with \fBgit\fR \fBnotes\fR \fBmerge\fR \fB\-\-commit\fR, or abort the merge with \fBgit\fR \fBnotes\fR \fBmerge\fR \fB\-\-abort\fR\&.
  353. .sp
  354. Users may select an automated merge strategy from among the following using either \fB\-s\fR/\fB\-\-strategy\fR option or configuring \fBnotes\&.mergeStrategy\fR accordingly:
  355. .sp
  356. \fBours\fR automatically resolves conflicting notes in favor of the local version (i\&.e\&. the current notes ref)\&.
  357. .sp
  358. \fBtheirs\fR automatically resolves notes conflicts in favor of the remote version (i\&.e\&. the given notes ref being merged into the current notes ref)\&.
  359. .sp
  360. \fBunion\fR automatically resolves notes conflicts by concatenating the local and remote versions\&.
  361. .sp
  362. \fBcat_sort_uniq\fR is similar to \fBunion\fR, but in addition to concatenating the local and remote versions, this strategy also sorts the resulting lines, and removes duplicate lines from the result\&. This is equivalent to applying the "cat | sort | uniq" shell pipeline to the local and remote versions\&. This strategy is useful if the notes follow a line\-based format where one wants to avoid duplicated lines in the merge result\&. Note that if either the local or remote version contain duplicate lines prior to the merge, these will also be removed by this notes merge strategy\&.
  363. .SH "EXAMPLES"
  364. .sp
  365. You can use notes to add annotations with information that was not available at the time a commit was written\&.
  366. .sp
  367. .if n \{\
  368. .RS 4
  369. .\}
  370. .nf
  371. $ git notes add \-m \*(AqTested\-by: Johannes Sixt <j6t@kdbg\&.org>\*(Aq 72a144e2
  372. $ git show \-s 72a144e
  373. [\&.\&.\&.]
  374. Signed\-off\-by: Junio C Hamano <gitster@pobox\&.com>
  375. Notes:
  376. Tested\-by: Johannes Sixt <j6t@kdbg\&.org>
  377. .fi
  378. .if n \{\
  379. .RE
  380. .\}
  381. .sp
  382. In principle, a note is a regular Git blob, and any kind of (non\-)format is accepted\&. You can binary\-safely create notes from arbitrary files using \fBgit\fR \fBhash\-object\fR:
  383. .sp
  384. .if n \{\
  385. .RS 4
  386. .\}
  387. .nf
  388. $ cc *\&.c
  389. $ blob=$(git hash\-object \-w a\&.out)
  390. $ git notes \-\-ref=built add \-\-allow\-empty \-C "$blob" HEAD
  391. .fi
  392. .if n \{\
  393. .RE
  394. .\}
  395. .sp
  396. (You cannot simply use \fBgit\fR \fBnotes\fR \fB\-\-ref=built\fR \fBadd\fR \fB\-F\fR \fBa\&.out\fR \fBHEAD\fR because that is not binary\-safe\&.) Of course, it doesn\(cqt make much sense to display non\-text\-format notes with \fBgit\fR \fBlog\fR, so if you use such notes, you\(cqll probably need to write some special\-purpose tools to do something useful with them\&.
  397. .SH "CONFIGURATION"
  398. .PP
  399. \fBcore\&.notesRef\fR
  400. .RS 4
  401. Notes ref to read and manipulate instead of
  402. \fBrefs/notes/commits\fR\&. Must be an unabbreviated ref name\&. This setting can be overridden through the environment and command line\&.
  403. .RE
  404. .sp
  405. Everything above this line in this section isn\(cqt included from the \fBgit-config\fR(1) documentation\&. The content that follows is the same as what\(cqs found there:
  406. .PP
  407. \fBnotes\&.mergeStrategy\fR
  408. .RS 4
  409. Which merge strategy to choose by default when resolving notes conflicts\&. Must be one of
  410. \fBmanual\fR,
  411. \fBours\fR,
  412. \fBtheirs\fR,
  413. \fBunion\fR, or
  414. \fBcat_sort_uniq\fR\&. Defaults to
  415. \fBmanual\fR\&. See the "NOTES MERGE STRATEGIES" section of
  416. \fBgit-notes\fR(1)
  417. for more information on each strategy\&.
  418. .sp
  419. This setting can be overridden by passing the
  420. \fB\-\-strategy\fR
  421. option to
  422. \fBgit-notes\fR(1)\&.
  423. .RE
  424. .PP
  425. \fBnotes\&.\fR\fI<name>\fR\fB\&.mergeStrategy\fR
  426. .RS 4
  427. Which merge strategy to choose when doing a notes merge into
  428. \fBrefs/notes/\fR\fI<name>\fR\&. This overrides the more general
  429. \fBnotes\&.mergeStrategy\fR\&. See the "NOTES MERGE STRATEGIES" section in
  430. \fBgit-notes\fR(1)
  431. for more information on the available strategies\&.
  432. .RE
  433. .PP
  434. \fBnotes\&.displayRef\fR
  435. .RS 4
  436. Which ref (or refs, if a glob or specified more than once), in addition to the default set by
  437. \fBcore\&.notesRef\fR
  438. or
  439. \fBGIT_NOTES_REF\fR, to read notes from when showing commit messages with the
  440. \fBgit\fR
  441. \fBlog\fR
  442. family of commands\&.
  443. .sp
  444. This setting can be overridden with the
  445. \fBGIT_NOTES_DISPLAY_REF\fR
  446. environment variable, which must be a colon separated list of refs or globs\&.
  447. .sp
  448. A warning will be issued for refs that do not exist, but a glob that does not match any refs is silently ignored\&.
  449. .sp
  450. This setting can be disabled by the
  451. \fB\-\-no\-notes\fR
  452. option to the
  453. \fBgit-log\fR(1)
  454. family of commands, or by the
  455. \fB\-\-notes=\fR\fI<ref>\fR
  456. option accepted by those commands\&.
  457. .sp
  458. The effective value of
  459. \fBcore\&.notesRef\fR
  460. (possibly overridden by
  461. \fBGIT_NOTES_REF\fR) is also implicitly added to the list of refs to be displayed\&.
  462. .RE
  463. .PP
  464. \fBnotes\&.rewrite\&.\fR\fI<command>\fR
  465. .RS 4
  466. When rewriting commits with
  467. \fI<command>\fR
  468. (currently
  469. \fBamend\fR
  470. or
  471. \fBrebase\fR), if this variable is
  472. \fBfalse\fR, git will not copy notes from the original to the rewritten commit\&. Defaults to
  473. \fBtrue\fR\&. See also
  474. \fBnotes\&.rewriteRef\fR
  475. below\&.
  476. .sp
  477. This setting can be overridden with the
  478. \fBGIT_NOTES_REWRITE_REF\fR
  479. environment variable, which must be a colon separated list of refs or globs\&.
  480. .RE
  481. .PP
  482. \fBnotes\&.rewriteMode\fR
  483. .RS 4
  484. When copying notes during a rewrite (see the
  485. \fBnotes\&.rewrite\&.\fR\fI<command>\fR
  486. option), determines what to do if the target commit already has a note\&. Must be one of
  487. \fBoverwrite\fR,
  488. \fBconcatenate\fR,
  489. \fBcat_sort_uniq\fR, or
  490. \fBignore\fR\&. Defaults to
  491. \fBconcatenate\fR\&.
  492. .sp
  493. This setting can be overridden with the
  494. \fBGIT_NOTES_REWRITE_MODE\fR
  495. environment variable\&.
  496. .RE
  497. .PP
  498. \fBnotes\&.rewriteRef\fR
  499. .RS 4
  500. When copying notes during a rewrite, specifies the (fully qualified) ref whose notes should be copied\&. May be a glob, in which case notes in all matching refs will be copied\&. You may also specify this configuration several times\&.
  501. .sp
  502. Does not have a default value; you must configure this variable to enable note rewriting\&. Set it to
  503. \fBrefs/notes/commits\fR
  504. to enable rewriting for the default commit notes\&.
  505. .sp
  506. Can be overridden with the
  507. \fBGIT_NOTES_REWRITE_REF\fR
  508. environment variable\&. See
  509. \fBnotes\&.rewrite\&.\fR\fI<command>\fR
  510. above for a further description of its format\&.
  511. .RE
  512. .SH "ENVIRONMENT"
  513. .PP
  514. \fBGIT_NOTES_REF\fR
  515. .RS 4
  516. Which ref to manipulate notes from, instead of
  517. \fBrefs/notes/commits\fR\&. This overrides the
  518. \fBcore\&.notesRef\fR
  519. setting\&.
  520. .RE
  521. .PP
  522. \fBGIT_NOTES_DISPLAY_REF\fR
  523. .RS 4
  524. Colon\-delimited list of refs or globs indicating which refs, in addition to the default from
  525. \fBcore\&.notesRef\fR
  526. or
  527. \fBGIT_NOTES_REF\fR, to read notes from when showing commit messages\&. This overrides the
  528. \fBnotes\&.displayRef\fR
  529. setting\&.
  530. .sp
  531. A warning will be issued for refs that do not exist, but a glob that does not match any refs is silently ignored\&.
  532. .RE
  533. .PP
  534. \fBGIT_NOTES_REWRITE_MODE\fR
  535. .RS 4
  536. When copying notes during a rewrite, what to do if the target commit already has a note\&. Must be one of
  537. \fBoverwrite\fR,
  538. \fBconcatenate\fR,
  539. \fBcat_sort_uniq\fR, or
  540. \fBignore\fR\&. This overrides the
  541. \fBcore\&.rewriteMode\fR
  542. setting\&.
  543. .RE
  544. .PP
  545. \fBGIT_NOTES_REWRITE_REF\fR
  546. .RS 4
  547. When rewriting commits, which notes to copy from the original to the rewritten commit\&. Must be a colon\-delimited list of refs or globs\&.
  548. .sp
  549. If not set in the environment, the list of notes to copy depends on the
  550. \fBnotes\&.rewrite\&.\fR\fI<command>\fR
  551. and
  552. \fBnotes\&.rewriteRef\fR
  553. settings\&.
  554. .RE
  555. .SH "GIT"
  556. .sp
  557. Part of the \fBgit\fR(1) suite
  558. .SH "NOTES"
  559. .IP " 1." 4
  560. Permitted pathnames have the form \fIbf\fR\fB/\fR\fIfe\fR\fB/\fR\fI30\fR\fB/\fR\fI\&...\:\fR\fB/\fR\fI680d5a\&...\:\fR: a sequence of directory names of two hexadecimal digits each followed by a filename with the rest of the object ID.