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