1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/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 and 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> | --textconv ) <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 its first form, the command provides the content or the type of an object in
\r
25 the repository. The type is required unless <emphasis>-t</emphasis> or <emphasis>-p</emphasis> is used to find the
\r
26 object type, or <emphasis>-s</emphasis> is used to find the object size, or <emphasis>--textconv</emphasis> is used
\r
27 (which implies type "blob").</simpara>
\r
28 <simpara>In the second form, a list of objects (separated by linefeeds) is provided on
\r
29 stdin, and the SHA1, type, and size of each object is printed on stdout.</simpara>
\r
31 <simplesect id="_options">
\r
32 <title>OPTIONS</title>
\r
40 The name of the object to show.
\r
41 For a more complete list of ways to spell object names, see
\r
42 the "SPECIFYING REVISIONS" section in <xref linkend="gitrevisions(7)" />.
\r
52 Instead of the content, show the object type identified by
\r
63 Instead of the content, show the object size identified by
\r
74 Suppress all output; instead exit with zero status if <object>
\r
75 exists and is a valid object.
\r
85 Pretty-print the contents of <object> based on its type.
\r
95 Typically this matches the real type of <object> but asking
\r
96 for a type that can trivially be dereferenced from the given
\r
97 <object> is also permitted. An example is to ask for a
\r
98 "tree" with <object> being a commit object that contains it,
\r
99 or to ask for a "blob" with <object> being a tag object that
\r
110 Show the content as transformed by a textconv filter. In this case,
\r
111 <object> has be of the form <treeish>:<path>, or :<path> in order
\r
112 to apply the filter to the content recorded in the index at <path>.
\r
122 Print the SHA1, type, size, and contents of each object provided on
\r
123 stdin. May not be combined with any other options or arguments.
\r
133 Print the SHA1, type, and size of each object provided on stdin. May not
\r
134 be combined with any other options or arguments.
\r
140 <simplesect id="_output">
\r
141 <title>OUTPUT</title>
\r
142 <simpara>If <emphasis>-t</emphasis> is specified, one of the <type>.</simpara>
\r
143 <simpara>If <emphasis>-s</emphasis> is specified, the size of the <object> in bytes.</simpara>
\r
144 <simpara>If <emphasis>-e</emphasis> is specified, no output.</simpara>
\r
145 <simpara>If <emphasis>-p</emphasis> is specified, the contents of <object> are pretty-printed.</simpara>
\r
146 <simpara>If <type> is specified, the raw (though uncompressed) contents of the <object>
\r
147 will be returned.</simpara>
\r
148 <simpara>If <emphasis>--batch</emphasis> is specified, output of the following form is printed for each
\r
149 object specified on stdin:</simpara>
\r
150 <screen><sha1> SP <type> SP <size> LF
\r
151 <contents> LF</screen>
\r
152 <simpara>If <emphasis>--batch-check</emphasis> is specified, output of the following form is printed for
\r
153 each object specified on stdin:</simpara>
\r
154 <screen><sha1> SP <type> SP <size> LF</screen>
\r
155 <simpara>For both <emphasis>--batch</emphasis> and <emphasis>--batch-check</emphasis>, output of the following form is printed
\r
156 for each object specified on stdin that does not exist in the repository:</simpara>
\r
157 <screen><object> SP missing LF</screen>
\r
159 <simplesect id="_git">
\r
161 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r