1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
\r
4 <article lang="en" id="git-cat-file(1)">
\r
6 <title>git-cat-file(1)</title>
\r
8 <primary>git-cat-file(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-cat-file - Provide content or type/size information for repository objects</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git cat-file</emphasis> [-t | -s | -e | -p | <type>] <object>
\r
19 <emphasis>git cat-file</emphasis> [--batch | --batch-check] < <list-of-objects></literallayout>
\r
22 <simplesect id="_description">
\r
23 <title>DESCRIPTION</title>
\r
24 <simpara>In the first form, provides content or type of objects in the repository. The
\r
25 type is required unless <emphasis>-t</emphasis> or <emphasis>-p</emphasis> is used to find the object type, or <emphasis>-s</emphasis>
\r
26 is used to find the object size.</simpara>
\r
27 <simpara>In the second form, a list of object (separated by LFs) is provided on stdin,
\r
28 and the SHA1, type, and size of each object is printed on stdout.</simpara>
\r
30 <simplesect id="_options">
\r
31 <title>OPTIONS</title>
\r
39 The name of the object to show.
\r
40 For a more complete list of ways to spell object names, see
\r
41 "SPECIFYING REVISIONS" section in <xref linkend="git-rev-parse(1)"/>.
\r
51 Instead of the content, show the object type identified by
\r
62 Instead of the content, show the object size identified by
\r
73 Suppress all output; instead exit with zero status if <object>
\r
74 exists and is a valid object.
\r
84 Pretty-print the contents of <object> based on its type.
\r
94 Typically this matches the real type of <object> but asking
\r
95 for a type that can trivially be dereferenced from the given
\r
96 <object> is also permitted. An example is to ask for a
\r
97 "tree" with <object> being a commit object that contains it,
\r
98 or to ask for a "blob" with <object> being a tag object that
\r
109 Print the SHA1, type, size, and contents of each object provided on
\r
110 stdin. May not be combined with any other options or arguments.
\r
120 Print the SHA1, type, and size of each object provided on stdin. May not be
\r
121 combined with any other options or arguments.
\r
127 <simplesect id="_output">
\r
128 <title>OUTPUT</title>
\r
129 <simpara>If <emphasis>-t</emphasis> is specified, one of the <type>.</simpara>
\r
130 <simpara>If <emphasis>-s</emphasis> is specified, the size of the <object> in bytes.</simpara>
\r
131 <simpara>If <emphasis>-e</emphasis> is specified, no output.</simpara>
\r
132 <simpara>If <emphasis>-p</emphasis> is specified, the contents of <object> are pretty-printed.</simpara>
\r
133 <simpara>If <type> is specified, the raw (though uncompressed) contents of the <object>
\r
134 will be returned.</simpara>
\r
135 <simpara>If <emphasis>--batch</emphasis> is specified, output of the following form is printed for each
\r
136 object specified on stdin:</simpara>
\r
137 <literallayout><sha1> SP <type> SP <size> LF
\r
138 <contents> LF</literallayout>
\r
139 <simpara>If <emphasis>--batch-check</emphasis> is specified, output of the following form is printed for
\r
140 each object specified on stdin:</simpara>
\r
141 <literallayout><sha1> SP <type> SP <size> LF</literallayout>
\r
142 <simpara>For both <emphasis>--batch</emphasis> and <emphasis>--batch-check</emphasis>, output of the following form is printed
\r
143 for each object specified on stdin that does not exist in the repository:</simpara>
\r
144 <literallayout><object> SP missing LF</literallayout>
\r
146 <simplesect id="_author">
\r
147 <title>Author</title>
\r
148 <simpara>Written by Linus Torvalds <<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>></simpara>
\r
150 <simplesect id="_documentation">
\r
151 <title>Documentation</title>
\r
152 <simpara>Documentation by David Greaves, Junio C Hamano and the git-list <<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>>.</simpara>
\r
154 <simplesect id="_git">
\r
156 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r