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 git\-rev\-parse [ \-\-option ] <args>...
31 Many git Porcelainish commands take mixture of flags (i\&.e\&. parameters that begin with a dash \-) 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 ^ and strip ^ prefix from the object names that already have one\&.
69 Usually the object names are output in SHA1 form (with possible ^ 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)\&.
84 \-\-since=datestring, \-\-after=datestring
85 Parses the date string, and outputs corresponding \-\-max\-age= parameter for git\-rev\-list command\&.
88 \-\-until=datestring, \-\-before=datestring
89 Parses the date string, and outputs corresponding \-\-min\-age= parameter for git\-rev\-list command\&.
93 Flags and parameters to be parsed\&.
95 .SH "SPECIFYING REVISIONS"
98 A revision parameter typically, but not necessarily, names a commit object\&. They use what is called an extended SHA1 syntax\&.
102 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\&.
105 A symbolic ref name\&. E\&.g\&. master 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 heads/master to tell git which one you mean\&.
108 A suffix ^ to a revision parameter means the first parent of that commit object\&. ^<n> means the <n>th parent (i\&.e\&. rev^ is equivalent to rev^1)\&. As a special rule, rev^0 means the commit itself and is used when rev is the object name of a tag object that refers to a commit object\&.
111 A suffix ~<n> 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\&.
114 A suffix ^ 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}\&.
117 A suffix ^ 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\&.
121 git\-rev\-parse also accepts a prefix ^ to revision parameter, which is passed to git\-rev\-list\&. Two revision parameters concatenated with \&.\&. is a short\-hand for writing a range between them\&. I\&.e\&. r1\&.\&.r2 is equivalent to saying ^r1 r2
124 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\&.
143 D = A^^ = A^1^1 = A~2
146 G = A^^^ = A^1^1^1 = A~3
147 H = D^2 = B^^2 = A^^^2 = A~2^2
148 I = F^ = B^3^ = A^^3^
149 J = F^2 = B^3^2 = A^^3^2
155 Written by Linus Torvalds <torvalds@osdl\&.org> and Junio C Hamano <junkio@cox\&.net>
160 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
165 Part of the \fBgit\fR(7) suite