]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-cat-file.txt
Merge branch 'js/merge-recursive'
[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--------
ed90cbf5 11'git-cat-file' [-t | -s | -e | -p | <type>] <object>
a8128ed6 12'git-cat-file' [--batch | --batch-check] < <list-of-objects>
2cf565c5
DG
13
14DESCRIPTION
15-----------
05d5667f
AR
16In the first form, provides content or type of objects in the repository. The
17type is required unless '-t' or '-p' is used to find the object type, or '-s'
18is used to find the object size.
19
20In the second form, a list of object (separated by LFs) is provided on stdin,
21and the SHA1, type, and size of each object is printed on stdout.
2cf565c5
DG
22
23OPTIONS
24-------
25<object>::
8933364d
AK
26 The name of the object to show.
27 For a more complete list of ways to spell object names, see
5162e697 28 "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
2cf565c5
DG
29
30-t::
31 Instead of the content, show the object type identified by
32 <object>.
33
62bb9960
JH
34-s::
35 Instead of the content, show the object size identified by
36 <object>.
37
7950571a
PA
38-e::
39 Suppress all output; instead exit with zero status if <object>
40 exists and is a valid object.
41
ed90cbf5
JK
42-p::
43 Pretty-print the contents of <object> based on its type.
44
2cf565c5
DG
45<type>::
46 Typically this matches the real type of <object> but asking
f73ae1fc 47 for a type that can trivially be dereferenced from the given
2cf565c5
DG
48 <object> is also permitted. An example is to ask for a
49 "tree" with <object> being a commit object that contains it,
50 or to ask for a "blob" with <object> being a tag object that
51 points at it.
52
a8128ed6
AR
53--batch::
54 Print the SHA1, type, size, and contents of each object provided on
55 stdin. May not be combined with any other options or arguments.
56
05d5667f
AR
57--batch-check::
58 Print the SHA1, type, and size of each object provided on stdin. May not be
59 combined with any other options or arguments.
60
2cf565c5
DG
61OUTPUT
62------
7950571a
PA
63If '-t' is specified, one of the <type>.
64
65If '-s' is specified, the size of the <object> in bytes.
66
67If '-e' is specified, no output.
2cf565c5 68
ed90cbf5
JK
69If '-p' is specified, the contents of <object> are pretty-printed.
70
05d5667f
AR
71If <type> is specified, the raw (though uncompressed) contents of the <object>
72will be returned.
73
a8128ed6
AR
74If '--batch' is specified, output of the following form is printed for each
75object specified on stdin:
76
77------------
78<sha1> SP <type> SP <size> LF
79<contents> LF
80------------
81
05d5667f
AR
82If '--batch-check' is specified, output of the following form is printed for
83each object specified fon stdin:
84
85------------
86<sha1> SP <type> SP <size> LF
87------------
88
a8128ed6
AR
89For both '--batch' and '--batch-check', output of the following form is printed
90for each object specified on stdin that does not exist in the repository:
2cf565c5 91
05d5667f
AR
92------------
93<object> SP missing LF
94------------
2cf565c5
DG
95
96Author
97------
98Written by Linus Torvalds <torvalds@osdl.org>
99
100Documentation
101--------------
102Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
103
104GIT
105---
9e1f0a85 106Part of the linkgit:git[1] suite