]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-cat-file.txt
Documentation: rename gitlink macro to linkgit
[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>
2cf565c5
DG
12
13DESCRIPTION
14-----------
15Provides content or type of objects in the repository. The type
ed90cbf5 16is required unless '-t' or '-p' is used to find the object type,
62bb9960 17or '-s' is used to find the object size.
2cf565c5
DG
18
19OPTIONS
20-------
21<object>::
8933364d
AK
22 The name of the object to show.
23 For a more complete list of ways to spell object names, see
5162e697 24 "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
2cf565c5
DG
25
26-t::
27 Instead of the content, show the object type identified by
28 <object>.
29
62bb9960
JH
30-s::
31 Instead of the content, show the object size identified by
32 <object>.
33
7950571a
PA
34-e::
35 Suppress all output; instead exit with zero status if <object>
36 exists and is a valid object.
37
ed90cbf5
JK
38-p::
39 Pretty-print the contents of <object> based on its type.
40
2cf565c5
DG
41<type>::
42 Typically this matches the real type of <object> but asking
f73ae1fc 43 for a type that can trivially be dereferenced from the given
2cf565c5
DG
44 <object> is also permitted. An example is to ask for a
45 "tree" with <object> being a commit object that contains it,
46 or to ask for a "blob" with <object> being a tag object that
47 points at it.
48
49OUTPUT
50------
7950571a
PA
51If '-t' is specified, one of the <type>.
52
53If '-s' is specified, the size of the <object> in bytes.
54
55If '-e' is specified, no output.
2cf565c5 56
ed90cbf5
JK
57If '-p' is specified, the contents of <object> are pretty-printed.
58
2cf565c5
DG
59Otherwise the raw (though uncompressed) contents of the <object> will
60be returned.
61
62
63Author
64------
65Written by Linus Torvalds <torvalds@osdl.org>
66
67Documentation
68--------------
69Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
70
71GIT
72---
5162e697 73Part of the linkgit:git[7] suite