blob: 58c8d65772af4ef20ad573af9dd28691f5357437 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-cat-file(1)
2===============
3
4NAME
5----
Junio C Hamano1de75722009-03-26 08:39:386git-cat-file - Provide content or type and size information for repository objects
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamanodc8f25b2008-06-11 07:52:2811[verse]
Junio C Hamano9f10ed32009-05-26 08:38:5212'git cat-file' (-t | -s | -e | -p | <type>) <object>
13'git cat-file' (--batch | --batch-check) < <list-of-objects>
Junio C Hamano1a4e8412005-12-27 08:17:2314
15DESCRIPTION
16-----------
Junio C Hamano1de75722009-03-26 08:39:3817In its first form, the command provides the content or the type of an object in
18the repository. The type is required unless '-t' or '-p' is used to find the
19object type, or '-s' is used to find the object size.
Junio C Hamanodfccbb02008-05-26 01:16:1420
Junio C Hamano1de75722009-03-26 08:39:3821In the second form, a list of objects (separated by linefeeds) is provided on
22stdin, and the SHA1, type, and size of each object is printed on stdout.
Junio C Hamano1a4e8412005-12-27 08:17:2323
24OPTIONS
25-------
26<object>::
Junio C Hamano8f62db92007-02-01 00:22:2227The name of the object to show.
28For a more complete list of ways to spell object names, see
Junio C Hamano1de75722009-03-26 08:39:3829the "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
Junio C Hamano1a4e8412005-12-27 08:17:2330
31-t::
32Instead of the content, show the object type identified by
33<object>.
34
35-s::
36Instead of the content, show the object size identified by
37<object>.
38
39-e::
40Suppress all output; instead exit with zero status if <object>
41exists and is a valid object.
42
Junio C Hamano8eb323c2006-05-25 05:55:2243-p::
44Pretty-print the contents of <object> based on its type.
45
Junio C Hamano1a4e8412005-12-27 08:17:2346<type>::
47Typically this matches the real type of <object> but asking
48for 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,
51or to ask for a "blob" with <object> being a tag object that
52points at it.
53
Junio C Hamanodfccbb02008-05-26 01:16:1454--batch::
55Print the SHA1, type, size, and contents of each object provided on
56stdin. May not be combined with any other options or arguments.
57
58--batch-check::
Junio C Hamano1de75722009-03-26 08:39:3859Print the SHA1, type, and size of each object provided on stdin. May not
60be combined with any other options or arguments.
Junio C Hamanodfccbb02008-05-26 01:16:1461
Junio C Hamano1a4e8412005-12-27 08:17:2362OUTPUT
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
Junio C Hamano8eb323c2006-05-25 05:55:2270If '-p' is specified, the contents of <object> are pretty-printed.
71
Junio C Hamanodfccbb02008-05-26 01:16:1472If <type> is specified, the raw (though uncompressed) contents of the <object>
73will be returned.
Junio C Hamano1a4e8412005-12-27 08:17:2374
Junio C Hamanodfccbb02008-05-26 01:16:1475If '--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
Junio C Hamanocb1c44f2008-08-06 06:19:3384each object specified on stdin:
Junio C Hamanodfccbb02008-05-26 01:16:1485
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------------
Junio C Hamano1a4e8412005-12-27 08:17:2396
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---
Junio C Hamanof7c042d2008-06-06 22:50:53107Part of the linkgit:git[1] suite