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