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