Anonymous committed 6b09c78

Add revspec documentation for ':path', ':[0-3]:path' and git-describe

Signed-off-by: Nguyễn Thái Ngọc Duy <>
Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits 8a83157

Comments (0)

Files changed (1)


 A revision parameter typically, but not necessarily, names a
 commit object.  They use what is called an 'extended SHA1'
+syntax.  Here are various ways to spell object names.  The
+ones listed near the end of this list are to name trees and
+blobs contained in a commit.
 * The full SHA1 object name (40-byte hexadecimal string), or
   a substring of such that is unique within the repository.
   name the same commit object if there are no other object in
   your repository whose object name starts with dae86e.
+* An output from `git-describe`; i.e. a closest tag, followed by a
+  dash, a 'g', and an abbreviated object name.
 * 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
   and dereference the tag recursively until a non-tag object is
+* A suffix ':' followed by a path; this names the blob or tree
+  at the given path in the tree-ish object named by the part
+  before the colon.
+* A colon, optionally followed by a stage number (0 to 3) and a
+  colon, followed by a path; this names a blob object in the
+  index at the given path.  Missing stage number (and the colon
+  that follows it) names an stage 0 entry.
 Here is an illustration, by Jon Loeliger.  Both node B and C are
 a commit parents of commit node A.  Parent commits are ordered