updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-status.xml
blob70af6bdbf7dbdf2788833252c40458262f983f4e
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
3 \r
4 <article lang="en" id="git-status(1)">\r
5 <articleinfo>\r
6     <title>git-status(1)</title>\r
7 <indexterm>\r
8 <primary>git-status(1)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-status - Show the working tree status</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git status</emphasis> [&lt;options&gt;&#8230;] [--] [&lt;pathspec&gt;&#8230;]</literallayout>\r
19 </blockquote>\r
20 </simplesect>\r
21 <simplesect id="_description">\r
22 <title>DESCRIPTION</title>\r
23 <simpara>Displays paths that have differences between the index file and the\r
24 current HEAD commit, paths that have differences between the working\r
25 tree and the index file, and paths in the working tree that are not\r
26 tracked by git (and are not ignored by <xref linkend="gitignore(5)" />). The first\r
27 are what you <emphasis>would</emphasis> commit by running <emphasis>git commit</emphasis>; the second and\r
28 third are what you <emphasis>could</emphasis> commit by running <emphasis>git add</emphasis> before running\r
29 <emphasis>git commit</emphasis>.</simpara>\r
30 </simplesect>\r
31 <simplesect id="_options">\r
32 <title>OPTIONS</title>\r
33 <variablelist>\r
34 <varlistentry>\r
35 <term>\r
36 -s\r
37 </term>\r
38 <term>\r
39 --short\r
40 </term>\r
41 <listitem>\r
42 <simpara>\r
43         Give the output in the short-format.\r
44 </simpara>\r
45 </listitem>\r
46 </varlistentry>\r
47 <varlistentry>\r
48 <term>\r
49 -b\r
50 </term>\r
51 <term>\r
52 --branch\r
53 </term>\r
54 <listitem>\r
55 <simpara>\r
56         Show the branch and tracking info even in short-format.\r
57 </simpara>\r
58 </listitem>\r
59 </varlistentry>\r
60 <varlistentry>\r
61 <term>\r
62 --porcelain\r
63 </term>\r
64 <listitem>\r
65 <simpara>\r
66         Give the output in an easy-to-parse format for scripts.\r
67         This is similar to the short output, but will remain stable\r
68         across git versions and regardless of user configuration. See\r
69         below for details.\r
70 </simpara>\r
71 </listitem>\r
72 </varlistentry>\r
73 <varlistentry>\r
74 <term>\r
75 -u[&lt;mode&gt;]\r
76 </term>\r
77 <term>\r
78 --untracked-files[=&lt;mode&gt;]\r
79 </term>\r
80 <listitem>\r
81 <simpara>\r
82         Show untracked files.\r
83 </simpara>\r
84 <simpara>The mode parameter is optional (defaults to <emphasis>all</emphasis>), and is used to\r
85 specify the handling of untracked files; when -u is not used, the\r
86 default is <emphasis>normal</emphasis>, i.e. show untracked files and directories.</simpara>\r
87 <simpara>The possible options are:</simpara>\r
88 <itemizedlist>\r
89 <listitem>\r
90 <simpara>\r
91 <emphasis>no</emphasis>     - Show no untracked files\r
92 </simpara>\r
93 </listitem>\r
94 <listitem>\r
95 <simpara>\r
96 <emphasis>normal</emphasis> - Shows untracked files and directories\r
97 </simpara>\r
98 </listitem>\r
99 <listitem>\r
100 <simpara>\r
101 <emphasis>all</emphasis>    - Also shows individual files in untracked directories.\r
102 </simpara>\r
103 <simpara>The default can be changed using the status.showUntrackedFiles\r
104 configuration variable documented in <xref linkend="git-config(1)" />.</simpara>\r
105 </listitem>\r
106 </itemizedlist>\r
107 </listitem>\r
108 </varlistentry>\r
109 <varlistentry>\r
110 <term>\r
111 --ignore-submodules[=&lt;when&gt;]\r
112 </term>\r
113 <listitem>\r
114 <simpara>\r
115         Ignore changes to submodules when looking for changes. &lt;when&gt; can be\r
116         either "none", "untracked", "dirty" or "all", which is the default.\r
117         Using "none" will consider the submodule modified when it either contains\r
118         untracked or modified files or its HEAD differs from the commit recorded\r
119         in the superproject and can be used to override any settings of the\r
120         <emphasis>ignore</emphasis> option in <xref linkend="git-config(1)" /> or <xref linkend="gitmodules(5)" />. When\r
121         "untracked" is used submodules are not considered dirty when they only\r
122         contain untracked content (but they are still scanned for modified\r
123         content). Using "dirty" ignores all changes to the work tree of submodules,\r
124         only changes to the commits stored in the superproject are shown (this was\r
125         the behavior before 1.7.0). Using "all" hides all changes to submodules\r
126         (and suppresses the output of submodule summaries when the config option\r
127         <emphasis>status.submodulesummary</emphasis> is set).\r
128 </simpara>\r
129 </listitem>\r
130 </varlistentry>\r
131 <varlistentry>\r
132 <term>\r
133 --ignored\r
134 </term>\r
135 <listitem>\r
136 <simpara>\r
137         Show ignored files as well.\r
138 </simpara>\r
139 </listitem>\r
140 </varlistentry>\r
141 <varlistentry>\r
142 <term>\r
143 -z\r
144 </term>\r
145 <listitem>\r
146 <simpara>\r
147         Terminate entries with NUL, instead of LF.  This implies\r
148         the <emphasis>--porcelain</emphasis> output format if no other format is given.\r
149 </simpara>\r
150 </listitem>\r
151 </varlistentry>\r
152 </variablelist>\r
153 </simplesect>\r
154 <simplesect id="_output">\r
155 <title>OUTPUT</title>\r
156 <simpara>The output from this command is designed to be used as a commit\r
157 template comment, and all the output lines are prefixed with <emphasis>#</emphasis>.\r
158 The default, long format, is designed to be human readable,\r
159 verbose and descriptive.  Its contents and format are subject to change\r
160 at any time.</simpara>\r
161 <simpara>The paths mentioned in the output, unlike many other git commands, are\r
162 made relative to the current directory if you are working in a\r
163 subdirectory (this is on purpose, to help cutting and pasting). See\r
164 the status.relativePaths config option below.</simpara>\r
165 <section id="_short_format">\r
166 <title>Short Format</title>\r
167 <simpara>In the short-format, the status of each path is shown as</simpara>\r
168 <literallayout class="monospaced">XY PATH1 -&gt; PATH2</literallayout>\r
169 <simpara>where <emphasis>PATH1</emphasis> is the path in the <emphasis>HEAD</emphasis>, and the " <emphasis>-&gt; PATH2</emphasis>" part is\r
170 shown only when <emphasis>PATH1</emphasis> corresponds to a different path in the\r
171 index/worktree (i.e. the file is renamed). The <emphasis>XY</emphasis> is a two-letter\r
172 status code.</simpara>\r
173 <simpara>The fields (including the <emphasis>-&gt;</emphasis>) are separated from each other by a\r
174 single space. If a filename contains whitespace or other nonprintable\r
175 characters, that field will be quoted in the manner of a C string\r
176 literal: surrounded by ASCII double quote (34) characters, and with\r
177 interior special characters backslash-escaped.</simpara>\r
178 <simpara>For paths with merge conflicts, <emphasis>X</emphasis> and <emphasis>Y</emphasis> show the modification\r
179 states of each side of the merge. For paths that do not have merge\r
180 conflicts, <emphasis>X</emphasis> shows the status of the index, and <emphasis>Y</emphasis> shows the status\r
181 of the work tree.  For untracked paths, <emphasis>XY</emphasis> are <emphasis>??</emphasis>.  Other status\r
182 codes can be interpreted as follows:</simpara>\r
183 <itemizedlist>\r
184 <listitem>\r
185 <simpara>\r
186 ' ' = unmodified\r
187 </simpara>\r
188 </listitem>\r
189 <listitem>\r
190 <simpara>\r
191 <emphasis>M</emphasis> = modified\r
192 </simpara>\r
193 </listitem>\r
194 <listitem>\r
195 <simpara>\r
196 <emphasis>A</emphasis> = added\r
197 </simpara>\r
198 </listitem>\r
199 <listitem>\r
200 <simpara>\r
201 <emphasis>D</emphasis> = deleted\r
202 </simpara>\r
203 </listitem>\r
204 <listitem>\r
205 <simpara>\r
206 <emphasis>R</emphasis> = renamed\r
207 </simpara>\r
208 </listitem>\r
209 <listitem>\r
210 <simpara>\r
211 <emphasis>C</emphasis> = copied\r
212 </simpara>\r
213 </listitem>\r
214 <listitem>\r
215 <simpara>\r
216 <emphasis>U</emphasis> = updated but unmerged\r
217 </simpara>\r
218 </listitem>\r
219 </itemizedlist>\r
220 <simpara>Ignored files are not listed, unless <emphasis>--ignored</emphasis> option is in effect,\r
221 in which case <emphasis>XY</emphasis> are <emphasis>!!</emphasis>.</simpara>\r
222 <literallayout class="monospaced">X          Y     Meaning\r
223 -------------------------------------------------\r
224           [MD]   not updated\r
225 M        [ MD]   updated in index\r
226 A        [ MD]   added to index\r
227 D         [ M]   deleted from index\r
228 R        [ MD]   renamed in index\r
229 C        [ MD]   copied in index\r
230 [MARC]           index and work tree matches\r
231 [ MARC]     M    work tree changed since index\r
232 [ MARC]     D    deleted in work tree\r
233 -------------------------------------------------\r
234 D           D    unmerged, both deleted\r
235 A           U    unmerged, added by us\r
236 U           D    unmerged, deleted by them\r
237 U           A    unmerged, added by them\r
238 D           U    unmerged, deleted by us\r
239 A           A    unmerged, both added\r
240 U           U    unmerged, both modified\r
241 -------------------------------------------------\r
242 ?           ?    untracked\r
243 !           !    ignored\r
244 -------------------------------------------------</literallayout>\r
245 <simpara>If -b is used the short-format status is preceded by a line</simpara>\r
246 <simpara>## branchname tracking info</simpara>\r
247 </section>\r
248 <section id="_porcelain_format">\r
249 <title>Porcelain Format</title>\r
250 <simpara>The porcelain format is similar to the short format, but is guaranteed\r
251 not to change in a backwards-incompatible way between git versions or\r
252 based on user configuration. This makes it ideal for parsing by scripts.\r
253 The description of the short format above also describes the porcelain\r
254 format, with a few exceptions:</simpara>\r
255 <orderedlist numeration="arabic">\r
256 <listitem>\r
257 <simpara>\r
258 The user's color.status configuration is not respected; color will\r
259    always be off.\r
260 </simpara>\r
261 </listitem>\r
262 <listitem>\r
263 <simpara>\r
264 The user's status.relativePaths configuration is not respected; paths\r
265    shown will always be relative to the repository root.\r
266 </simpara>\r
267 </listitem>\r
268 </orderedlist>\r
269 <simpara>There is also an alternate -z format recommended for machine parsing. In\r
270 that format, the status field is the same, but some other things\r
271 change.  First, the <emphasis>-&gt;</emphasis> is omitted from rename entries and the field\r
272 order is reversed (e.g <emphasis>from -&gt; to</emphasis> becomes <emphasis>to from</emphasis>). Second, a NUL\r
273 (ASCII 0) follows each filename, replacing space as a field separator\r
274 and the terminating newline (but a space still separates the status\r
275 field from the first filename).  Third, filenames containing special\r
276 characters are not specially formatted; no quoting or\r
277 backslash-escaping is performed.</simpara>\r
278 </section>\r
279 </simplesect>\r
280 <simplesect id="_configuration">\r
281 <title>CONFIGURATION</title>\r
282 <simpara>The command honors <emphasis>color.status</emphasis> (or <emphasis>status.color</emphasis> -- they\r
283 mean the same thing and the latter is kept for backward\r
284 compatibility) and <emphasis>color.status.&lt;slot&gt;</emphasis> configuration variables\r
285 to colorize its output.</simpara>\r
286 <simpara>If the config variable <emphasis>status.relativePaths</emphasis> is set to false, then all\r
287 paths shown are relative to the repository root, not to the current\r
288 directory.</simpara>\r
289 <simpara>If <emphasis>status.submodulesummary</emphasis> is set to a non zero number or true (identical\r
290 to -1 or an unlimited number), the submodule summary will be enabled for\r
291 the long format and a summary of commits for modified submodules will be\r
292 shown (see --summary-limit option of <xref linkend="git-submodule(1)" />).</simpara>\r
293 </simplesect>\r
294 <simplesect id="_see_also">\r
295 <title>SEE ALSO</title>\r
296 <simpara><xref linkend="gitignore(5)" /></simpara>\r
297 </simplesect>\r
298 <simplesect id="_git">\r
299 <title>GIT</title>\r
300 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
301 </simplesect>\r
302 </article>\r