1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
10 .de Sp \" Vertical space (when we can't use .PP)
16 .ie \\n(.$>=3 .ne \\$3
20 .TH "GIT-REV-PARSE" 1 "" "" ""
22 git-rev-parse \- Pick out and massage parameters.
26 \fIgit\-rev\-parse\fR [ \-\-option ] <args>...
31 Many git Porcelainish commands take mixture of flags (i\&.e\&. parameters that begin with a dash \fI\-\fR) and parameters meant for underlying git\-rev\-list command they use internally and flags and parameters for other commands they use as the downstream of git\-rev\-list\&. This command is used to distinguish between them\&.
37 Do not output flags and parameters not meant for git\-rev\-list command\&.
41 Do not output flags and parameters meant for git\-rev\-list command\&.
45 Do not output non\-flag parameters\&.
49 Do not output flag parameters\&.
53 If there is no parameter given by the user, use <arg> instead\&.
57 The parameter given must be usable as a single, valid object name\&. Otherwise barf and abort\&.
61 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 \-S with git\-diff\-*)\&.
65 When showing object names, prefix them with \fI^\fR and strip \fI^\fR prefix from the object names that already have one\&.
69 Usually the object names are output in SHA1 form (with possible \fI^\fR prefix); this option makes them output in a form as close to the original input as possible\&.
73 Show all refs found in $GIT_DIR/refs\&.
77 When the command is invoked from a subdirectory, show the path of the current directory relative to the top\-level directory\&.
81 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)\&.
85 Show $GIT_DIR if defined else show the path to the \&.git directory\&.
88 \-\-short, short=number
89 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\&.
92 \-\-since=datestring, \-\-after=datestring
93 Parses the date string, and outputs corresponding \-\-max\-age= parameter for git\-rev\-list command\&.
96 \-\-until=datestring, \-\-before=datestring
97 Parses the date string, and outputs corresponding \-\-min\-age= parameter for git\-rev\-list command\&.
101 Flags and parameters to be parsed\&.
103 .SH "SPECIFYING REVISIONS"
106 A revision parameter typically, but not necessarily, names a commit object\&. They use what is called an \fIextended SHA1\fR syntax\&.
110 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\&.
113 A symbolic ref name\&. E\&.g\&. \fImaster\fR 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 \fIheads/master\fR to tell git which one you mean\&.
116 A suffix \fI^\fR to a revision parameter means the first parent of that commit object\&. \fI^<n>\fR means the <n>th parent (i\&.e\&. \fIrev^\fR is equivalent to \fIrev^1\fR)\&. As a special rule, \fIrev^0\fR means the commit itself and is used when \fIrev\fR is the object name of a tag object that refers to a commit object\&.
119 A suffix \fI~<n>\fR 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\&.
122 A suffix \fI^\fR followed by an object type name enclosed in brace pair (e\&.g\&. v0\&.99\&.8^{commit}) 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)\&. rev^0 introduced earlier is a short\-hand for rev^{commit}\&.
125 A suffix \fI^\fR followed by an empty brace pair (e\&.g\&. v0\&.99\&.8^{}) means the object could be a tag, and dereference the tag recursively until a non\-tag object is found\&.
129 \fIgit\-rev\-parse\fR also accepts a prefix \fI^\fR to revision parameter, which is passed to \fIgit\-rev\-list\fR\&. Two revision parameters concatenated with \fI\&.\&.\fR is a short\-hand for writing a range between them\&. I\&.e\&. \fIr1\&.\&.r2\fR is equivalent to saying \fI^r1 r2\fR
132 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\&.
151 D = A^^ = A^1^1 = A~2
154 G = A^^^ = A^1^1^1 = A~3
155 H = D^2 = B^^2 = A^^^2 = A~2^2
156 I = F^ = B^3^ = A^^3^
157 J = F^2 = B^3^2 = A^^3^2
163 Written by Linus Torvalds <torvalds@osdl\&.org> and Junio C Hamano <junkio@cox\&.net>
168 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
173 Part of the \fBgit\fR(7) suite