1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
\r
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
\r
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
\r
6 <meta name="generator" content="AsciiDoc 7.0.2" />
\r
7 <style type="text/css">
\r
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
\r
11 border: 1px solid red;
\r
16 margin: 1em 5% 1em 5%;
\r
20 a:visited { color: fuchsia; }
\r
34 h1, h2, h3, h4, h5, h6 {
\r
36 font-family: sans-serif;
\r
38 margin-bottom: 0.5em;
\r
43 border-bottom: 2px solid silver;
\r
46 border-bottom: 2px solid silver;
\r
56 border: 1px solid silver;
\r
61 margin-bottom: 0.5em;
\r
71 font-family: sans-serif;
\r
78 font-family: sans-serif;
\r
82 font-family: sans-serif;
\r
84 border-top: 2px solid silver;
\r
90 padding-bottom: 0.5em;
\r
94 padding-bottom: 0.5em;
\r
98 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
\r
99 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
\r
100 div.admonitionblock {
\r
103 margin-bottom: 1.5em;
\r
105 div.admonitionblock {
\r
107 margin-bottom: 2.5em;
\r
110 div.content { /* Block element content. */
\r
114 /* Block element titles. */
\r
115 div.title, caption.title {
\r
116 font-family: sans-serif;
\r
120 margin-bottom: 0.5em;
\r
126 td div.title:first-child {
\r
129 div.content div.title:first-child {
\r
132 div.content + div.title {
\r
136 div.sidebarblock > div.content {
\r
137 background: #ffffee;
\r
138 border: 1px solid silver;
\r
142 div.listingblock > div.content {
\r
143 border: 1px solid silver;
\r
144 background: #f4f4f4;
\r
148 div.quoteblock > div.content {
\r
149 padding-left: 2.0em;
\r
151 div.quoteblock .attribution {
\r
155 div.admonitionblock .icon {
\r
156 vertical-align: top;
\r
159 text-decoration: underline;
\r
161 padding-right: 0.5em;
\r
163 div.admonitionblock td.content {
\r
164 padding-left: 0.5em;
\r
165 border-left: 2px solid silver;
\r
168 div.exampleblock > div.content {
\r
169 border-left: 2px solid silver;
\r
173 div.verseblock div.content {
\r
177 div.imageblock div.content { padding-left: 0; }
\r
178 div.imageblock img { border: 1px solid silver; }
\r
179 span.image img { border-style: none; }
\r
183 margin-bottom: 0.8em;
\r
188 font-style: italic;
\r
190 dd > *:first-child {
\r
195 list-style-position: outside;
\r
198 list-style-type: lower-alpha;
\r
201 div.tableblock > table {
\r
202 border-color: #527bbd;
\r
206 font-family: sans-serif;
\r
215 margin-bottom: 0.8em;
\r
218 vertical-align: top;
\r
219 font-style: italic;
\r
220 padding-right: 0.8em;
\r
223 vertical-align: top;
\r
227 div#footer-badges { display: none; }
\r
229 include::./stylesheets/xhtml11-manpage.css[]
\r
230 /* Workarounds for IE6's broken and incomplete CSS2. */
\r
232 div.sidebar-content {
\r
233 background: #ffffee;
\r
234 border: 1px solid silver;
\r
237 div.sidebar-title, div.image-title {
\r
238 font-family: sans-serif;
\r
241 margin-bottom: 0.5em;
\r
244 div.listingblock div.content {
\r
245 border: 1px solid silver;
\r
246 background: #f4f4f4;
\r
250 div.quoteblock-content {
\r
251 padding-left: 2.0em;
\r
254 div.exampleblock-content {
\r
255 border-left: 2px solid silver;
\r
256 padding-left: 0.5em;
\r
259 <title>git-rev-parse(1)</title>
\r
264 git-rev-parse(1) Manual Page
\r
267 <div class="sectionbody">
\r
269 Pick out and massage parameters
\r
274 <div class="sectionbody">
\r
275 <p><em>git-rev-parse</em> [ --option ] <args>…</p>
\r
277 <h2>DESCRIPTION</h2>
\r
278 <div class="sectionbody">
\r
279 <p>Many git Porcelainish commands take mixture of flags
\r
280 (i.e. parameters that begin with a dash <em>-</em>) and parameters
\r
281 meant for underlying <tt>git-rev-list</tt> command they use internally
\r
282 and flags and parameters for other commands they use as the
\r
283 downstream of <tt>git-rev-list</tt>. This command is used to
\r
284 distinguish between them.</p>
\r
287 <div class="sectionbody">
\r
294 Do not output flags and parameters not meant for
\r
295 <tt>git-rev-list</tt> command.
\r
303 Do not output flags and parameters meant for
\r
304 <tt>git-rev-list</tt> command.
\r
312 Do not output non-flag parameters.
\r
320 Do not output flag parameters.
\r
324 --default <arg>
\r
328 If there is no parameter given by the user, use <tt><arg></tt>
\r
337 The parameter given must be usable as a single, valid
\r
338 object name. Otherwise barf and abort.
\r
346 Usually the output is made one line per flag and
\r
347 parameter. This option makes output a single line,
\r
348 properly quoted for consumption by shell. Useful when
\r
349 you expect your parameter to contain whitespaces and
\r
350 newlines (e.g. when using pickaxe <tt>-S</tt> with
\r
351 <tt>git-diff-*</tt>).
\r
359 When showing object names, prefix them with <em>^</em> and
\r
360 strip <em>^</em> prefix from the object names that already have
\r
369 Usually the object names are output in SHA1 form (with
\r
370 possible <em>^</em> prefix); this option makes them output in a
\r
371 form as close to the original input as possible.
\r
379 Show all refs found in <tt>$GIT_DIR/refs</tt>.
\r
387 When the command is invoked from a subdirectory, show the
\r
388 path of the current directory relative to the top-level
\r
397 When the command is invoked from a subdirectory, show the
\r
398 path of the top-level directory relative to the current
\r
399 directory (typically a sequence of "../", or an empty string).
\r
407 Show <tt>$GIT_DIR</tt> if defined else show the path to the .git directory.
\r
411 --short, --short=number
\r
415 Instead of outputting the full SHA1 values of object names try to
\r
416 abbriviate them to a shorter unique name. When no length is specified
\r
417 7 is used. The minimum length is 4.
\r
421 --since=datestring, --after=datestring
\r
425 Parses the date string, and outputs corresponding
\r
426 --max-age= parameter for git-rev-list command.
\r
430 --until=datestring, --before=datestring
\r
434 Parses the date string, and outputs corresponding
\r
435 --min-age= parameter for git-rev-list command.
\r
439 <args>…
\r
443 Flags and parameters to be parsed.
\r
448 <h2>SPECIFYING REVISIONS</h2>
\r
449 <div class="sectionbody">
\r
450 <p>A revision parameter typically, but not necessarily, names a
\r
451 commit object. They use what is called an <em>extended SHA1</em>
\r
456 The full SHA1 object name (40-byte hexadecimal string), or
\r
457 a substring of such that is unique within the repository.
\r
458 E.g. dae86e1950b1277e545cee180551750029cfe735 and dae86e both
\r
459 name the same commit object if there are no other object in
\r
460 your repository whose object name starts with dae86e.
\r
465 A symbolic ref name. E.g. <em>master</em> typically means the commit
\r
466 object referenced by $GIT_DIR/refs/heads/master. If you
\r
467 happen to have both heads/master and tags/master, you can
\r
468 explicitly say <em>heads/master</em> to tell git which one you mean.
\r
473 A suffix <em>^</em> to a revision parameter means the first parent of
\r
474 that commit object. <em>^<n></em> means the <n>th parent (i.e.
\r
476 is equivalent to <em>rev^1</em>). As a special rule,
\r
477 <em>rev^0</em> means the commit itself and is used when <em>rev</em> is the
\r
478 object name of a tag object that refers to a commit object.
\r
483 A suffix <em>~<n></em> to a revision parameter means the commit
\r
484 object that is the <n>th generation grand-parent of the named
\r
485 commit object, following only the first parent. I.e. rev~3 is
\r
486 equivalent to rev^^^ which is equivalent to rev^1^1^1.
\r
491 A suffix <em>^</em> followed by an object type name enclosed in
\r
492 brace pair (e.g. <tt>v0.99.8^{commit}</tt>) means the object
\r
493 could be a tag, and dereference the tag recursively until an
\r
494 object of that type is found or the object cannot be
\r
495 dereferenced anymore (in which case, barf). <tt>rev^0</tt>
\r
496 introduced earlier is a short-hand for <tt>rev^{commit}</tt>.
\r
501 A suffix <em>^</em> followed by an empty brace pair
\r
502 (e.g. <tt>v0.99.8^{}</tt>) means the object could be a tag,
\r
503 and dereference the tag recursively until a non-tag object is
\r
508 <p><em>git-rev-parse</em> also accepts a prefix <em>^</em> to revision parameter,
\r
509 which is passed to <em>git-rev-list</em>. Two revision parameters
\r
510 concatenated with <em>..</em> is a short-hand for writing a range
\r
511 between them. I.e. <em>r1..r2</em> is equivalent to saying <em>^r1 r2</em></p>
\r
512 <p>Here is an illustration, by Jon Loeliger. Both node B and C are
\r
513 a commit parents of commit node A. Parent commits are ordered
\r
515 <div class="literalblock">
\r
516 <div class="content">
\r
528 <div class="literalblock">
\r
529 <div class="content">
\r
533 D = A^^ = A^1^1 = A~2
\r
536 G = A^^^ = A^1^1^1 = A~3
\r
537 H = D^2 = B^^2 = A^^^2 = A~2^2
\r
538 I = F^ = B^3^ = A^^3^
\r
539 J = F^2 = B^3^2 = A^^3^2</tt></pre>
\r
543 <div class="sectionbody">
\r
544 <p>Written by Linus Torvalds <torvalds@osdl.org> and
\r
545 Junio C Hamano <junkio@cox.net></p>
\r
547 <h2>Documentation</h2>
\r
548 <div class="sectionbody">
\r
549 <p>Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.</p>
\r
552 <div class="sectionbody">
\r
553 <p>Part of the <a href="git.html">git(7)</a> suite</p>
\r
556 <div id="footer-text">
\r
557 Last updated 10-Mar-2006 00:31:34 UTC
\r