]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-cat-file.txt
Documentation: be consistent about "git-" versus "git "
[thirdparty/git.git] / Documentation / git-cat-file.txt
CommitLineData
2cf565c5
DG
1git-cat-file(1)
2===============
2cf565c5
DG
3
4NAME
5----
c3f0baac 6git-cat-file - Provide content or type/size information for repository objects
2cf565c5
DG
7
8
9SYNOPSIS
10--------
cdf222f5 11[verse]
b1889c36
JN
12'git cat-file' [-t | -s | -e | -p | <type>] <object>
13'git cat-file' [--batch | --batch-check] < <list-of-objects>
2cf565c5
DG
14
15DESCRIPTION
16-----------
05d5667f
AR
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.
2cf565c5
DG
23
24OPTIONS
25-------
26<object>::
8933364d
AK
27 The name of the object to show.
28 For a more complete list of ways to spell object names, see
5162e697 29 "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
2cf565c5
DG
30
31-t::
32 Instead of the content, show the object type identified by
33 <object>.
34
62bb9960
JH
35-s::
36 Instead of the content, show the object size identified by
37 <object>.
38
7950571a
PA
39-e::
40 Suppress all output; instead exit with zero status if <object>
41 exists and is a valid object.
42
ed90cbf5
JK
43-p::
44 Pretty-print the contents of <object> based on its type.
45
2cf565c5
DG
46<type>::
47 Typically this matches the real type of <object> but asking
f73ae1fc 48 for a type that can trivially be dereferenced from the given
2cf565c5
DG
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
a8128ed6
AR
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
05d5667f
AR
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
2cf565c5
DG
62OUTPUT
63------
7950571a
PA
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.
2cf565c5 69
ed90cbf5
JK
70If '-p' is specified, the contents of <object> are pretty-printed.
71
05d5667f
AR
72If <type> is specified, the raw (though uncompressed) contents of the <object>
73will be returned.
74
a8128ed6
AR
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
05d5667f
AR
83If '--batch-check' is specified, output of the following form is printed for
84each object specified fon stdin:
85
86------------
87<sha1> SP <type> SP <size> LF
88------------
89
a8128ed6
AR
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:
2cf565c5 92
05d5667f
AR
93------------
94<object> SP missing LF
95------------
2cf565c5
DG
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---
9e1f0a85 107Part of the linkgit:git[1] suite