<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" | |
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta name="generator" content="AsciiDoc 8.2.5" /> | |
<style type="text/css"> | |
/* Debug borders */ | |
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { | |
/* | |
border: 1px solid red; | |
*/ | |
} | |
body { | |
margin: 1em 5% 1em 5%; | |
} | |
a { | |
color: blue; | |
text-decoration: underline; | |
} | |
a:visited { | |
color: fuchsia; | |
} | |
em { | |
font-style: italic; | |
} | |
strong { | |
font-weight: bold; | |
} | |
tt { | |
color: navy; | |
} | |
h1, h2, h3, h4, h5, h6 { | |
color: #527bbd; | |
font-family: sans-serif; | |
margin-top: 1.2em; | |
margin-bottom: 0.5em; | |
line-height: 1.3; | |
} | |
h1, h2, h3 { | |
border-bottom: 2px solid silver; | |
} | |
h2 { | |
padding-top: 0.5em; | |
} | |
h3 { | |
float: left; | |
} | |
h3 + * { | |
clear: left; | |
} | |
div.sectionbody { | |
font-family: serif; | |
margin-left: 0; | |
} | |
hr { | |
border: 1px solid silver; | |
} | |
p { | |
margin-top: 0.5em; | |
margin-bottom: 0.5em; | |
} | |
pre { | |
padding: 0; | |
margin: 0; | |
} | |
span#author { | |
color: #527bbd; | |
font-family: sans-serif; | |
font-weight: bold; | |
font-size: 1.1em; | |
} | |
span#email { | |
} | |
span#revision { | |
font-family: sans-serif; | |
} | |
div#footer { | |
font-family: sans-serif; | |
font-size: small; | |
border-top: 2px solid silver; | |
padding-top: 0.5em; | |
margin-top: 4.0em; | |
} | |
div#footer-text { | |
float: left; | |
padding-bottom: 0.5em; | |
} | |
div#footer-badges { | |
float: right; | |
padding-bottom: 0.5em; | |
} | |
div#preamble, | |
div.tableblock, div.imageblock, div.exampleblock, div.verseblock, | |
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, | |
div.admonitionblock { | |
margin-right: 10%; | |
margin-top: 1.5em; | |
margin-bottom: 1.5em; | |
} | |
div.admonitionblock { | |
margin-top: 2.5em; | |
margin-bottom: 2.5em; | |
} | |
div.content { /* Block element content. */ | |
padding: 0; | |
} | |
/* Block element titles. */ | |
div.title, caption.title { | |
font-family: sans-serif; | |
font-weight: bold; | |
text-align: left; | |
margin-top: 1.0em; | |
margin-bottom: 0.5em; | |
} | |
div.title + * { | |
margin-top: 0; | |
} | |
td div.title:first-child { | |
margin-top: 0.0em; | |
} | |
div.content div.title:first-child { | |
margin-top: 0.0em; | |
} | |
div.content + div.title { | |
margin-top: 0.0em; | |
} | |
div.sidebarblock > div.content { | |
background: #ffffee; | |
border: 1px solid silver; | |
padding: 0.5em; | |
} | |
div.listingblock { | |
margin-right: 0%; | |
} | |
div.listingblock > div.content { | |
border: 1px solid silver; | |
background: #f4f4f4; | |
padding: 0.5em; | |
} | |
div.quoteblock > div.content { | |
padding-left: 2.0em; | |
} | |
div.attribution { | |
text-align: right; | |
} | |
div.verseblock + div.attribution { | |
text-align: left; | |
} | |
div.admonitionblock .icon { | |
vertical-align: top; | |
font-size: 1.1em; | |
font-weight: bold; | |
text-decoration: underline; | |
color: #527bbd; | |
padding-right: 0.5em; | |
} | |
div.admonitionblock td.content { | |
padding-left: 0.5em; | |
border-left: 2px solid silver; | |
} | |
div.exampleblock > div.content { | |
border-left: 2px solid silver; | |
padding: 0.5em; | |
} | |
div.verseblock div.content { | |
white-space: pre; | |
} | |
div.imageblock div.content { padding-left: 0; } | |
div.imageblock img { border: 1px solid silver; } | |
span.image img { border-style: none; } | |
dl { | |
margin-top: 0.8em; | |
margin-bottom: 0.8em; | |
} | |
dt { | |
margin-top: 0.5em; | |
margin-bottom: 0; | |
font-style: italic; | |
} | |
dd > *:first-child { | |
margin-top: 0; | |
} | |
ul, ol { | |
list-style-position: outside; | |
} | |
div.olist2 ol { | |
list-style-type: lower-alpha; | |
} | |
div.tableblock > table { | |
border: 3px solid #527bbd; | |
} | |
thead { | |
font-family: sans-serif; | |
font-weight: bold; | |
} | |
tfoot { | |
font-weight: bold; | |
} | |
div.hlist { | |
margin-top: 0.8em; | |
margin-bottom: 0.8em; | |
} | |
div.hlist td { | |
padding-bottom: 5px; | |
} | |
td.hlist1 { | |
vertical-align: top; | |
font-style: italic; | |
padding-right: 0.8em; | |
} | |
td.hlist2 { | |
vertical-align: top; | |
} | |
@media print { | |
div#footer-badges { display: none; } | |
} | |
div#toctitle { | |
color: #527bbd; | |
font-family: sans-serif; | |
font-size: 1.1em; | |
font-weight: bold; | |
margin-top: 1.0em; | |
margin-bottom: 0.1em; | |
} | |
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { | |
margin-top: 0; | |
margin-bottom: 0; | |
} | |
div.toclevel2 { | |
margin-left: 2em; | |
font-size: 0.9em; | |
} | |
div.toclevel3 { | |
margin-left: 4em; | |
font-size: 0.9em; | |
} | |
div.toclevel4 { | |
margin-left: 6em; | |
font-size: 0.9em; | |
} | |
include1::./stylesheets/xhtml11-manpage.css[] | |
/* Workarounds for IE6's broken and incomplete CSS2. */ | |
div.sidebar-content { | |
background: #ffffee; | |
border: 1px solid silver; | |
padding: 0.5em; | |
} | |
div.sidebar-title, div.image-title { | |
font-family: sans-serif; | |
font-weight: bold; | |
margin-top: 0.0em; | |
margin-bottom: 0.5em; | |
} | |
div.listingblock div.content { | |
border: 1px solid silver; | |
background: #f4f4f4; | |
padding: 0.5em; | |
} | |
div.quoteblock-content { | |
padding-left: 2.0em; | |
} | |
div.exampleblock-content { | |
border-left: 2px solid silver; | |
padding-left: 0.5em; | |
} | |
/* IE6 sets dynamically generated links as visited. */ | |
div#toc a:visited { color: blue; } | |
</style> | |
<title>git-notes(1)</title> | |
</head> | |
<body> | |
<div id="header"> | |
<h1> | |
git-notes(1) Manual Page | |
</h1> | |
<h2>NAME</h2> | |
<div class="sectionbody"> | |
<p>git-notes - | |
Add or inspect object notes | |
</p> | |
</div> | |
</div> | |
<h2>SYNOPSIS</h2> | |
<div class="sectionbody"> | |
<div class="verseblock"> | |
<div class="content"><em>git notes</em> [list [<object>]] | |
<em>git notes</em> add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] | |
<em>git notes</em> copy [-f] ( --stdin | <from-object> <to-object> ) | |
<em>git notes</em> append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] | |
<em>git notes</em> edit [<object>] | |
<em>git notes</em> show [<object>] | |
<em>git notes</em> remove [<object>] | |
<em>git notes</em> prune [-n | -v]</div></div> | |
</div> | |
<h2 id="_description">DESCRIPTION</h2> | |
<div class="sectionbody"> | |
<div class="para"><p>Adds, removes, or reads notes attached to objects, without touching | |
the objects themselves.</p></div> | |
<div class="para"><p>By default, notes are saved to and read from <tt>refs/notes/commits</tt>, 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.</p></div> | |
<div class="para"><p>A typical use of notes is to supplement a commit message without | |
changing the commit itself. Notes can be shown by <em>git log</em> 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 <tt>refs/notes/commits</tt>).</p></div> | |
<div class="para"><p>To change which notes are shown by <em>git log</em>, see the | |
"notes.displayRef" configuration in <a href="git-log.html">git-log(1)</a>.</p></div> | |
<div class="para"><p>See the "notes.rewrite.<command>" configuration for a way to carry | |
notes across commands that rewrite commits.</p></div> | |
</div> | |
<h2 id="_subcommands">SUBCOMMANDS</h2> | |
<div class="sectionbody"> | |
<div class="vlist"><dl> | |
<dt> | |
list | |
</dt> | |
<dd> | |
<p> | |
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. | |
</p> | |
</dd> | |
<dt> | |
add | |
</dt> | |
<dd> | |
<p> | |
Add notes for a given object (defaults to HEAD). Abort if the | |
object already has notes (use <tt>-f</tt> to overwrite an | |
existing note). | |
</p> | |
</dd> | |
<dt> | |
copy | |
</dt> | |
<dd> | |
<p> | |
Copy the notes for the first object onto the second object. | |
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: | |
<tt>git notes add [-f] -C $(git notes list <from-object>) <to-object></tt> | |
</p> | |
<div class="para"><p>In <tt>--stdin</tt> mode, take lines in the format</p></div> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt><from-object> SP <to-object> [ SP <rest> ] LF</tt></pre> | |
</div></div> | |
<div class="para"><p>on standard input, and copy the notes from each <from-object> to its | |
corresponding <to-object>. (The optional <tt><rest></tt> is ignored so that | |
the command can read the input given to the <tt>post-rewrite</tt> hook.)</p></div> | |
</dd> | |
<dt> | |
append | |
</dt> | |
<dd> | |
<p> | |
Append to the notes of an existing object (defaults to HEAD). | |
Creates a new notes object if needed. | |
</p> | |
</dd> | |
<dt> | |
edit | |
</dt> | |
<dd> | |
<p> | |
Edit the notes for a given object (defaults to HEAD). | |
</p> | |
</dd> | |
<dt> | |
show | |
</dt> | |
<dd> | |
<p> | |
Show the notes for a given object (defaults to HEAD). | |
</p> | |
</dd> | |
<dt> | |
remove | |
</dt> | |
<dd> | |
<p> | |
Remove the notes for a given object (defaults to HEAD). | |
This is equivalent to specifying an empty note message to | |
the <tt>edit</tt> subcommand. | |
</p> | |
</dd> | |
<dt> | |
prune | |
</dt> | |
<dd> | |
<p> | |
Remove all notes for non-existing/unreachable objects. | |
</p> | |
</dd> | |
</dl></div> | |
</div> | |
<h2 id="_options">OPTIONS</h2> | |
<div class="sectionbody"> | |
<div class="vlist"><dl> | |
<dt> | |
-f | |
</dt> | |
<dt> | |
--force | |
</dt> | |
<dd> | |
<p> | |
When adding notes to an object that already has notes, | |
overwrite the existing notes (instead of aborting). | |
</p> | |
</dd> | |
<dt> | |
-m <msg> | |
</dt> | |
<dt> | |
--message=<msg> | |
</dt> | |
<dd> | |
<p> | |
Use the given note message (instead of prompting). | |
If multiple <tt>-m</tt> options are given, their values | |
are concatenated as separate paragraphs. | |
Lines starting with <tt>#</tt> and empty lines other than a | |
single line between paragraphs will be stripped out. | |
</p> | |
</dd> | |
<dt> | |
-F <file> | |
</dt> | |
<dt> | |
--file=<file> | |
</dt> | |
<dd> | |
<p> | |
Take the note message from the given file. Use <em>-</em> to | |
read the note message from the standard input. | |
Lines starting with <tt>#</tt> and empty lines other than a | |
single line between paragraphs will be stripped out. | |
</p> | |
</dd> | |
<dt> | |
-C <object> | |
</dt> | |
<dt> | |
--reuse-message=<object> | |
</dt> | |
<dd> | |
<p> | |
Take the note message from the given blob object (for | |
example, another note). | |
</p> | |
</dd> | |
<dt> | |
-c <object> | |
</dt> | |
<dt> | |
--reedit-message=<object> | |
</dt> | |
<dd> | |
<p> | |
Like <em>-C</em>, but with <em>-c</em> the editor is invoked, so that | |
the user can further edit the note message. | |
</p> | |
</dd> | |
<dt> | |
--ref <ref> | |
</dt> | |
<dd> | |
<p> | |
Manipulate the notes tree in <ref>. This overrides | |
<em>GIT_NOTES_REF</em> and the "core.notesRef" configuration. The ref | |
is taken to be in <tt>refs/notes/</tt> if it is not qualified. | |
</p> | |
</dd> | |
<dt> | |
-n | |
</dt> | |
<dt> | |
--dry-run | |
</dt> | |
<dd> | |
<p> | |
Do not remove anything; just report the object names whose notes | |
would be removed. | |
</p> | |
</dd> | |
<dt> | |
-v | |
</dt> | |
<dt> | |
--verbose | |
</dt> | |
<dd> | |
<p> | |
Report all object names whose notes are removed. | |
</p> | |
</dd> | |
</dl></div> | |
</div> | |
<h2 id="_discussion">DISCUSSION</h2> | |
<div class="sectionbody"> | |
<div class="para"><p>Commit notes are blobs containing extra information about an object | |
(usually information to supplement a commit's 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 <br />[Permitted pathnames have the form | |
<em>ab</em><tt>/</tt><em>cd</em><tt>/</tt><em>ef</em><tt>/</tt><em>…</em><tt>/</tt><em>abcdef…</em>: a sequence of directory | |
names of two hexadecimal digits each followed by a filename with the | |
rest of the object ID.]<br />.</p></div> | |
<div class="para"><p>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., | |
<tt>git log -p notes/commits</tt>. Currently the commit message only records | |
which operation triggered the update, and the commit authorship is | |
determined according to the usual rules (see <a href="git-commit.html">git-commit(1)</a>). | |
These details may change in the future.</p></div> | |
<div class="para"><p>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 | |
<tt>git log -p -g <refname></tt>.</p></div> | |
</div> | |
<h2 id="_examples">EXAMPLES</h2> | |
<div class="sectionbody"> | |
<div class="para"><p>You can use notes to add annotations with information that was not | |
available at the time a commit was written.</p></div> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt>$ git notes add -m 'Tested-by: Johannes Sixt <j6t@kdbg.org>' 72a144e2 | |
$ git show -s 72a144e | |
[...] | |
Signed-off-by: Junio C Hamano <gitster@pobox.com> | |
Notes: | |
Tested-by: Johannes Sixt <j6t@kdbg.org></tt></pre> | |
</div></div> | |
<div class="para"><p>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 <em>git hash-object</em>:</p></div> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt>$ cc *.c | |
$ blob=$(git hash-object -w a.out) | |
$ git notes --ref=built add -C "$blob" HEAD</tt></pre> | |
</div></div> | |
<div class="para"><p>Of course, it doesn't make much sense to display non-text-format notes | |
with <em>git log</em>, so if you use such notes, you'll probably need to write | |
some special-purpose tools to do something useful with them.</p></div> | |
</div> | |
<h2 id="_configuration">CONFIGURATION</h2> | |
<div class="sectionbody"> | |
<div class="vlist"><dl> | |
<dt> | |
core.notesRef | |
</dt> | |
<dd> | |
<p> | |
Notes ref to read and manipulate instead of | |
<tt>refs/notes/commits</tt>. Must be an unabbreviated ref name. | |
This setting can be overridden through the environment and | |
command line. | |
</p> | |
</dd> | |
<dt> | |
notes.displayRef | |
</dt> | |
<dd> | |
<p> | |
Which ref (or refs, if a glob or specified more than once), in | |
addition to the default set by <tt>core.notesRef</tt> or | |
<em>GIT_NOTES_REF</em>, to read notes from when showing commit | |
messages with the <em>git log</em> family of commands. | |
This setting can be overridden on the command line or by the | |
<em>GIT_NOTES_DISPLAY_REF</em> environment variable. | |
See <a href="git-log.html">git-log(1)</a>. | |
</p> | |
</dd> | |
<dt> | |
notes.rewrite.<command> | |
</dt> | |
<dd> | |
<p> | |
When rewriting commits with <command> (currently <tt>amend</tt> or | |
<tt>rebase</tt>), if this variable is <tt>false</tt>, git will not copy | |
notes from the original to the rewritten commit. Defaults to | |
<tt>true</tt>. See also "<tt>notes.rewriteRef</tt>" below. | |
</p> | |
<div class="para"><p>This setting can be overridden by the <em>GIT_NOTES_REWRITE_REF</em> | |
environment variable.</p></div> | |
</dd> | |
<dt> | |
notes.rewriteMode | |
</dt> | |
<dd> | |
<p> | |
When copying notes during a rewrite, what to do if the target | |
commit already has a note. Must be one of <tt>overwrite</tt>, | |
<tt>concatenate</tt>, and <tt>ignore</tt>. Defaults to <tt>concatenate</tt>. | |
</p> | |
<div class="para"><p>This setting can be overridden with the <tt>GIT_NOTES_REWRITE_MODE</tt> | |
environment variable.</p></div> | |
</dd> | |
<dt> | |
notes.rewriteRef | |
</dt> | |
<dd> | |
<p> | |
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. | |
</p> | |
<div class="para"><p>Does not have a default value; you must configure this variable to | |
enable note rewriting.</p></div> | |
<div class="para"><p>Can be overridden with the <em>GIT_NOTES_REWRITE_REF</em> environment variable.</p></div> | |
</dd> | |
</dl></div> | |
</div> | |
<h2 id="_environment">ENVIRONMENT</h2> | |
<div class="sectionbody"> | |
<div class="vlist"><dl> | |
<dt> | |
<em>GIT_NOTES_REF</em> | |
</dt> | |
<dd> | |
<p> | |
Which ref to manipulate notes from, instead of <tt>refs/notes/commits</tt>. | |
This overrides the <tt>core.notesRef</tt> setting. | |
</p> | |
</dd> | |
<dt> | |
<em>GIT_NOTES_DISPLAY_REF</em> | |
</dt> | |
<dd> | |
<p> | |
Colon-delimited list of refs or globs indicating which refs, | |
in addition to the default from <tt>core.notesRef</tt> or | |
<em>GIT_NOTES_REF</em>, to read notes from when showing commit | |
messages. | |
This overrides the <tt>notes.displayRef</tt> setting. | |
</p> | |
<div class="para"><p>A warning will be issued for refs that do not exist, but a glob that | |
does not match any refs is silently ignored.</p></div> | |
</dd> | |
<dt> | |
<em>GIT_NOTES_REWRITE_MODE</em> | |
</dt> | |
<dd> | |
<p> | |
When copying notes during a rewrite, what to do if the target | |
commit already has a note. | |
Must be one of <tt>overwrite</tt>, <tt>concatenate</tt>, and <tt>ignore</tt>. | |
This overrides the <tt>core.rewriteMode</tt> setting. | |
</p> | |
</dd> | |
<dt> | |
<em>GIT_NOTES_REWRITE_REF</em> | |
</dt> | |
<dd> | |
<p> | |
When rewriting commits, which notes to copy from the original | |
to the rewritten commit. Must be a colon-delimited list of | |
refs or globs. | |
</p> | |
<div class="para"><p>If not set in the environment, the list of notes to copy depends | |
on the <tt>notes.rewrite.<command></tt> and <tt>notes.rewriteRef</tt> settings.</p></div> | |
</dd> | |
</dl></div> | |
</div> | |
<h2 id="_author">Author</h2> | |
<div class="sectionbody"> | |
<div class="para"><p>Written by Johannes Schindelin <johannes.schindelin@gmx.de> and | |
Johan Herland <johan@herland.net></p></div> | |
</div> | |
<h2 id="_documentation">Documentation</h2> | |
<div class="sectionbody"> | |
<div class="para"><p>Documentation by Johannes Schindelin and Johan Herland</p></div> | |
</div> | |
<h2 id="_git">GIT</h2> | |
<div class="sectionbody"> | |
<div class="para"><p>Part of the <a href="git.html">git(7)</a> suite</p></div> | |
</div> | |
<div id="footer"> | |
<div id="footer-text"> | |
Last updated 2010-09-18 23:56:50 UTC | |
</div> | |
</div> | |
</body> | |
</html> |