Documentation / git-cat-file.txton commit Improve error output of git-rebase (9b752a6)
   1git-cat-file(1)
   2===============
   3
   4NAME
   5----
   6git-cat-file - Provide content or type/size information for repository objects
   7
   8
   9SYNOPSIS
  10--------
  11[verse]
  12'git cat-file' [-t | -s | -e | -p | <type>] <object>
  13'git cat-file' [--batch | --batch-check] < <list-of-objects>
  14
  15DESCRIPTION
  16-----------
  17In the first form, provides content or type of objects in the repository. The
  18type is required unless '-t' or '-p' is used to find the object type, or '-s'
  19is used to find the object size.
  20
  21In the second form, a list of object (separated by LFs) is provided on stdin,
  22and the SHA1, type, and size of each object is printed on stdout.
  23
  24OPTIONS
  25-------
  26<object>::
  27        The name of the object to show.
  28        For a more complete list of ways to spell object names, see
  29        "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
  30
  31-t::
  32        Instead of the content, show the object type identified by
  33        <object>.
  34
  35-s::
  36        Instead of the content, show the object size identified by
  37        <object>.
  38
  39-e::
  40        Suppress all output; instead exit with zero status if <object>
  41        exists and is a valid object.
  42
  43-p::
  44        Pretty-print the contents of <object> based on its type.
  45
  46<type>::
  47        Typically this matches the real type of <object> but asking
  48        for a type that can trivially be dereferenced from the given
  49        <object> is also permitted.  An example is to ask for a
  50        "tree" with <object> being a commit object that contains it,
  51        or to ask for a "blob" with <object> being a tag object that
  52        points at it.
  53
  54--batch::
  55        Print the SHA1, type, size, and contents of each object provided on
  56        stdin. May not be combined with any other options or arguments.
  57
  58--batch-check::
  59        Print the SHA1, type, and size of each object provided on stdin. May not be
  60        combined with any other options or arguments.
  61
  62OUTPUT
  63------
  64If '-t' is specified, one of the <type>.
  65
  66If '-s' is specified, the size of the <object> in bytes.
  67
  68If '-e' is specified, no output.
  69
  70If '-p' is specified, the contents of <object> are pretty-printed.
  71
  72If <type> is specified, the raw (though uncompressed) contents of the <object>
  73will be returned.
  74
  75If '--batch' is specified, output of the following form is printed for each
  76object specified on stdin:
  77
  78------------
  79<sha1> SP <type> SP <size> LF
  80<contents> LF
  81------------
  82
  83If '--batch-check' is specified, output of the following form is printed for
  84each object specified on stdin:
  85
  86------------
  87<sha1> SP <type> SP <size> LF
  88------------
  89
  90For both '--batch' and '--batch-check', output of the following form is printed
  91for each object specified on stdin that does not exist in the repository:
  92
  93------------
  94<object> SP missing LF
  95------------
  96
  97Author
  98------
  99Written by Linus Torvalds <torvalds@osdl.org>
 100
 101Documentation
 102--------------
 103Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
 104
 105GIT
 106---
 107Part of the linkgit:git[1] suite