blob: 2fb95bbd19f26317a542abfdb78d3b2be72f577b [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 Hamano4015aed2010-06-27 20:07:4212'git cat-file' (-t | -s | -e | -p | <type> | --textconv ) <object>
Junio C Hamano9f10ed32009-05-26 08:38:5213'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
Junio C Hamano4015aed2010-06-27 20:07:4219object type, or '-s' is used to find the object size, or '--textconv' is used
20(which implies type "blob").
Junio C Hamanodfccbb02008-05-26 01:16:1421
Junio C Hamano1de75722009-03-26 08:39:3822In the second form, a list of objects (separated by linefeeds) is provided on
23stdin, and the SHA1, type, and size of each object is printed on stdout.
Junio C Hamano1a4e8412005-12-27 08:17:2324
25OPTIONS
26-------
27<object>::
Junio C Hamano8f62db92007-02-01 00:22:2228The name of the object to show.
29For a more complete list of ways to spell object names, see
Junio C Hamanoc27b7332010-10-14 04:37:2830the "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
Junio C Hamano1a4e8412005-12-27 08:17:2331
32-t::
33Instead of the content, show the object type identified by
34<object>.
35
36-s::
37Instead of the content, show the object size identified by
38<object>.
39
40-e::
41Suppress all output; instead exit with zero status if <object>
42exists and is a valid object.
43
Junio C Hamano8eb323c2006-05-25 05:55:2244-p::
45Pretty-print the contents of <object> based on its type.
46
Junio C Hamano1a4e8412005-12-27 08:17:2347<type>::
48Typically this matches the real type of <object> but asking
49for a type that can trivially be dereferenced from the given
50<object> is also permitted. An example is to ask for a
51"tree" with <object> being a commit object that contains it,
52or to ask for a "blob" with <object> being a tag object that
53points at it.
54
Junio C Hamano4015aed2010-06-27 20:07:4255--textconv::
56Show the content as transformed by a textconv filter. In this case,
57<object> has be of the form <treeish>:<path>, or :<path> in order
58to apply the filter to the content recorded in the index at <path>.
59
Junio C Hamanodfccbb02008-05-26 01:16:1460--batch::
61Print the SHA1, type, size, and contents of each object provided on
62stdin. May not be combined with any other options or arguments.
63
64--batch-check::
Junio C Hamano1de75722009-03-26 08:39:3865Print the SHA1, type, and size of each object provided on stdin. May not
66be combined with any other options or arguments.
Junio C Hamanodfccbb02008-05-26 01:16:1467
Junio C Hamano1a4e8412005-12-27 08:17:2368OUTPUT
69------
70If '-t' is specified, one of the <type>.
71
72If '-s' is specified, the size of the <object> in bytes.
73
74If '-e' is specified, no output.
75
Junio C Hamano8eb323c2006-05-25 05:55:2276If '-p' is specified, the contents of <object> are pretty-printed.
77
Junio C Hamanodfccbb02008-05-26 01:16:1478If <type> is specified, the raw (though uncompressed) contents of the <object>
79will be returned.
Junio C Hamano1a4e8412005-12-27 08:17:2380
Junio C Hamanodfccbb02008-05-26 01:16:1481If '--batch' is specified, output of the following form is printed for each
82object specified on stdin:
83
84------------
85<sha1> SP <type> SP <size> LF
86<contents> LF
87------------
88
89If '--batch-check' is specified, output of the following form is printed for
Junio C Hamanocb1c44f2008-08-06 06:19:3390each object specified on stdin:
Junio C Hamanodfccbb02008-05-26 01:16:1491
92------------
93<sha1> SP <type> SP <size> LF
94------------
95
96For both '--batch' and '--batch-check', output of the following form is printed
97for each object specified on stdin that does not exist in the repository:
98
99------------
100<object> SP missing LF
101------------
Junio C Hamano1a4e8412005-12-27 08:17:23102
Junio C Hamano1a4e8412005-12-27 08:17:23103GIT
104---
Junio C Hamanof7c042d2008-06-06 22:50:53105Part of the linkgit:git[1] suite