| <!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 7.0.2" /> | |
| <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; } | |
| 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 { | |
| border-bottom: 2px solid silver; | |
| } | |
| h2 { | |
| border-bottom: 2px solid silver; | |
| padding-top: 0.5em; | |
| } | |
| 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.2em; | |
| } | |
| 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 > div.content { | |
| border: 1px solid silver; | |
| background: #f4f4f4; | |
| padding: 0.5em; | |
| } | |
| div.quoteblock > div.content { | |
| padding-left: 2.0em; | |
| } | |
| div.quoteblock .attribution { | |
| text-align: right; | |
| } | |
| 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; | |
| } | |
| ol.olist2 { | |
| list-style-type: lower-alpha; | |
| } | |
| div.tableblock > table { | |
| border-color: #527bbd; | |
| border-width: 3px; | |
| } | |
| thead { | |
| font-family: sans-serif; | |
| font-weight: bold; | |
| } | |
| tfoot { | |
| font-weight: bold; | |
| } | |
| div.hlist { | |
| margin-top: 0.8em; | |
| margin-bottom: 0.8em; | |
| } | |
| td.hlist1 { | |
| vertical-align: top; | |
| font-style: italic; | |
| padding-right: 0.8em; | |
| } | |
| td.hlist2 { | |
| vertical-align: top; | |
| } | |
| @media print { | |
| div#footer-badges { display: none; } | |
| } | |
| include::./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; | |
| } | |
| </style> | |
| <title>git-rev-parse(1)</title> | |
| </head> | |
| <body> | |
| <div id="header"> | |
| <h1> | |
| git-rev-parse(1) Manual Page | |
| </h1> | |
| <h2>NAME</h2> | |
| <div class="sectionbody"> | |
| <p>git-rev-parse - | |
| Pick out and massage parameters | |
| </p> | |
| </div> | |
| </div> | |
| <h2>SYNOPSIS</h2> | |
| <div class="sectionbody"> | |
| <p><em>git-rev-parse</em> [ --option ] <args>…</p> | |
| </div> | |
| <h2>DESCRIPTION</h2> | |
| <div class="sectionbody"> | |
| <p>Many git Porcelainish commands take mixture of flags | |
| (i.e. parameters that begin with a dash <em>-</em>) and parameters | |
| meant for underlying <tt>git-rev-list</tt> command they use internally | |
| and flags and parameters for other commands they use as the | |
| downstream of <tt>git-rev-list</tt>. This command is used to | |
| distinguish between them.</p> | |
| </div> | |
| <h2>OPTIONS</h2> | |
| <div class="sectionbody"> | |
| <dl> | |
| <dt> | |
| --revs-only | |
| </dt> | |
| <dd> | |
| <p> | |
| Do not output flags and parameters not meant for | |
| <tt>git-rev-list</tt> command. | |
| </p> | |
| </dd> | |
| <dt> | |
| --no-revs | |
| </dt> | |
| <dd> | |
| <p> | |
| Do not output flags and parameters meant for | |
| <tt>git-rev-list</tt> command. | |
| </p> | |
| </dd> | |
| <dt> | |
| --flags | |
| </dt> | |
| <dd> | |
| <p> | |
| Do not output non-flag parameters. | |
| </p> | |
| </dd> | |
| <dt> | |
| --no-flags | |
| </dt> | |
| <dd> | |
| <p> | |
| Do not output flag parameters. | |
| </p> | |
| </dd> | |
| <dt> | |
| --default <arg> | |
| </dt> | |
| <dd> | |
| <p> | |
| If there is no parameter given by the user, use <tt><arg></tt> | |
| instead. | |
| </p> | |
| </dd> | |
| <dt> | |
| --verify | |
| </dt> | |
| <dd> | |
| <p> | |
| The parameter given must be usable as a single, valid | |
| object name. Otherwise barf and abort. | |
| </p> | |
| </dd> | |
| <dt> | |
| --sq | |
| </dt> | |
| <dd> | |
| <p> | |
| Usually the output is made one line per flag and | |
| parameter. This option makes output a single line, | |
| properly quoted for consumption by shell. Useful when | |
| you expect your parameter to contain whitespaces and | |
| newlines (e.g. when using pickaxe <tt>-S</tt> with | |
| <tt>git-diff-*</tt>). | |
| </p> | |
| </dd> | |
| <dt> | |
| --not | |
| </dt> | |
| <dd> | |
| <p> | |
| When showing object names, prefix them with <em>^</em> and | |
| strip <em>^</em> prefix from the object names that already have | |
| one. | |
| </p> | |
| </dd> | |
| <dt> | |
| --symbolic | |
| </dt> | |
| <dd> | |
| <p> | |
| Usually the object names are output in SHA1 form (with | |
| possible <em>^</em> prefix); this option makes them output in a | |
| form as close to the original input as possible. | |
| </p> | |
| </dd> | |
| <dt> | |
| --all | |
| </dt> | |
| <dd> | |
| <p> | |
| Show all refs found in <tt>$GIT_DIR/refs</tt>. | |
| </p> | |
| </dd> | |
| <dt> | |
| --branches | |
| </dt> | |
| <dd> | |
| <p> | |
| Show branch refs found in <tt>$GIT_DIR/refs/heads</tt>. | |
| </p> | |
| </dd> | |
| <dt> | |
| --tags | |
| </dt> | |
| <dd> | |
| <p> | |
| Show tag refs found in <tt>$GIT_DIR/refs/tags</tt>. | |
| </p> | |
| </dd> | |
| <dt> | |
| --remotes | |
| </dt> | |
| <dd> | |
| <p> | |
| Show tag refs found in <tt>$GIT_DIR/refs/remotes</tt>. | |
| </p> | |
| </dd> | |
| <dt> | |
| --show-prefix | |
| </dt> | |
| <dd> | |
| <p> | |
| When the command is invoked from a subdirectory, show the | |
| path of the current directory relative to the top-level | |
| directory. | |
| </p> | |
| </dd> | |
| <dt> | |
| --show-cdup | |
| </dt> | |
| <dd> | |
| <p> | |
| When the command is invoked from a subdirectory, show the | |
| path of the top-level directory relative to the current | |
| directory (typically a sequence of "../", or an empty string). | |
| </p> | |
| </dd> | |
| <dt> | |
| --git-dir | |
| </dt> | |
| <dd> | |
| <p> | |
| Show <tt>$GIT_DIR</tt> if defined else show the path to the .git directory. | |
| </p> | |
| </dd> | |
| <dt> | |
| --short, --short=number | |
| </dt> | |
| <dd> | |
| <p> | |
| Instead of outputting the full SHA1 values of object names try to | |
| abbriviate them to a shorter unique name. When no length is specified | |
| 7 is used. The minimum length is 4. | |
| </p> | |
| </dd> | |
| <dt> | |
| --since=datestring, --after=datestring | |
| </dt> | |
| <dd> | |
| <p> | |
| Parses the date string, and outputs corresponding | |
| --max-age= parameter for git-rev-list command. | |
| </p> | |
| </dd> | |
| <dt> | |
| --until=datestring, --before=datestring | |
| </dt> | |
| <dd> | |
| <p> | |
| Parses the date string, and outputs corresponding | |
| --min-age= parameter for git-rev-list command. | |
| </p> | |
| </dd> | |
| <dt> | |
| <args>… | |
| </dt> | |
| <dd> | |
| <p> | |
| Flags and parameters to be parsed. | |
| </p> | |
| </dd> | |
| </dl> | |
| </div> | |
| <h2>SPECIFYING REVISIONS</h2> | |
| <div class="sectionbody"> | |
| <p>A revision parameter typically, but not necessarily, names a | |
| commit object. They use what is called an <em>extended SHA1</em> | |
| syntax.</p> | |
| <ul> | |
| <li> | |
| <p> | |
| The full SHA1 object name (40-byte hexadecimal string), or | |
| a substring of such that is unique within the repository. | |
| E.g. dae86e1950b1277e545cee180551750029cfe735 and dae86e both | |
| name the same commit object if there are no other object in | |
| your repository whose object name starts with dae86e. | |
| </p> | |
| </li> | |
| <li> | |
| <p> | |
| A symbolic ref name. E.g. <em>master</em> typically means the commit | |
| object referenced by $GIT_DIR/refs/heads/master. If you | |
| happen to have both heads/master and tags/master, you can | |
| explicitly say <em>heads/master</em> to tell git which one you mean. | |
| </p> | |
| </li> | |
| <li> | |
| <p> | |
| A suffix <em>^</em> to a revision parameter means the first parent of | |
| that commit object. <em>^<n></em> means the <n>th parent (i.e. | |
| <em>rev^</em> | |
| is equivalent to <em>rev^1</em>). As a special rule, | |
| <em>rev^0</em> means the commit itself and is used when <em>rev</em> is the | |
| object name of a tag object that refers to a commit object. | |
| </p> | |
| </li> | |
| <li> | |
| <p> | |
| A suffix <em>~<n></em> to a revision parameter means the commit | |
| object that is the <n>th generation grand-parent of the named | |
| commit object, following only the first parent. I.e. rev~3 is | |
| equivalent to rev^^^ which is equivalent to rev^1^1^1. | |
| </p> | |
| </li> | |
| <li> | |
| <p> | |
| A suffix <em>^</em> followed by an object type name enclosed in | |
| brace pair (e.g. <tt>v0.99.8^{commit}</tt>) means the object | |
| could be a tag, and dereference the tag recursively until an | |
| object of that type is found or the object cannot be | |
| dereferenced anymore (in which case, barf). <tt>rev^0</tt> | |
| introduced earlier is a short-hand for <tt>rev^{commit}</tt>. | |
| </p> | |
| </li> | |
| <li> | |
| <p> | |
| A suffix <em>^</em> followed by an empty brace pair | |
| (e.g. <tt>v0.99.8^{}</tt>) means the object could be a tag, | |
| and dereference the tag recursively until a non-tag object is | |
| found. | |
| </p> | |
| </li> | |
| </ul> | |
| <p><em>git-rev-parse</em> also accepts a prefix <em>^</em> to revision parameter, | |
| which is passed to <em>git-rev-list</em>. Two revision parameters | |
| concatenated with <em>..</em> is a short-hand for writing a range | |
| between them. I.e. <em>r1..r2</em> is equivalent to saying <em>^r1 r2</em></p> | |
| <p>Here is an illustration, by Jon Loeliger. Both node B and C are | |
| a commit parents of commit node A. Parent commits are ordered | |
| left-to-right.</p> | |
| <div class="literalblock"> | |
| <div class="content"> | |
| <pre><tt>G H I J | |
| \ / \ / | |
| D E F | |
| \ | / | |
| \ | / | |
| \|/ | |
| B C | |
| \ / | |
| \ / | |
| A</tt></pre> | |
| </div></div> | |
| <div class="literalblock"> | |
| <div class="content"> | |
| <pre><tt>A = = A^0 | |
| B = A^ = A^1 = A~1 | |
| C = A^2 = A^2 | |
| D = A^^ = A^1^1 = A~2 | |
| E = B^2 = A^^2 | |
| F = B^3 = A^^3 | |
| G = A^^^ = A^1^1^1 = A~3 | |
| H = D^2 = B^^2 = A^^^2 = A~2^2 | |
| I = F^ = B^3^ = A^^3^ | |
| J = F^2 = B^3^2 = A^^3^2</tt></pre> | |
| </div></div> | |
| </div> | |
| <h2>Author</h2> | |
| <div class="sectionbody"> | |
| <p>Written by Linus Torvalds <torvalds@osdl.org> and | |
| Junio C Hamano <junkio@cox.net></p> | |
| </div> | |
| <h2>Documentation</h2> | |
| <div class="sectionbody"> | |
| <p>Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.</p> | |
| </div> | |
| <h2>GIT</h2> | |
| <div class="sectionbody"> | |
| <p>Part of the <a href="git.html">git(7)</a> suite</p> | |
| </div> | |
| <div id="footer"> | |
| <div id="footer-text"> | |
| Last updated 17-May-2006 10:34:04 UTC | |
| </div> | |
| </div> | |
| </body> | |
| </html> |