Autogenerated HTML docs for v2.45.1-204-gd8ab1
[git-htmldocs.git] / git-status.html
blobd67bdfe859c266e185f7ae798ac258d31dc7c948
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5 <head>
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
7 <meta name="generator" content="AsciiDoc 10.2.0" />
8 <title>git-status(1)</title>
9 <style type="text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
12 /* Default font. */
13 body {
14 font-family: Georgia,serif;
17 /* Title font. */
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
21 #toctitle,
22 #author, #revnumber, #revdate, #revremark,
23 #footer {
24 font-family: Arial,Helvetica,sans-serif;
27 body {
28 margin: 1em 5% 1em 5%;
31 a {
32 color: blue;
33 text-decoration: underline;
35 a:visited {
36 color: fuchsia;
39 em {
40 font-style: italic;
41 color: navy;
44 strong {
45 font-weight: bold;
46 color: #083194;
49 h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
51 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
56 h1, h2, h3 {
57 border-bottom: 2px solid silver;
59 h2 {
60 padding-top: 0.5em;
62 h3 {
63 float: left;
65 h3 + * {
66 clear: left;
68 h5 {
69 font-size: 1.0em;
72 div.sectionbody {
73 margin-left: 0;
76 hr {
77 border: 1px solid silver;
80 p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
85 ul, ol, li > p {
86 margin-top: 0;
88 ul > li { color: #aaa; }
89 ul > li > * { color: black; }
91 .monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
95 padding: 0;
96 margin: 0;
98 pre {
99 white-space: pre-wrap;
102 #author {
103 color: #527bbd;
104 font-weight: bold;
105 font-size: 1.1em;
107 #email {
109 #revnumber, #revdate, #revremark {
112 #footer {
113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
118 #footer-text {
119 float: left;
120 padding-bottom: 0.5em;
122 #footer-badges {
123 float: right;
124 padding-bottom: 0.5em;
127 #preamble {
128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
134 margin-top: 1.0em;
135 margin-bottom: 1.5em;
137 div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
144 div.content { /* Block element content. */
145 padding: 0;
148 /* Block element titles. */
149 div.title, caption.title {
150 color: #527bbd;
151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
156 div.title + * {
157 margin-top: 0;
160 td div.title:first-child {
161 margin-top: 0.0em;
163 div.content div.title:first-child {
164 margin-top: 0.0em;
166 div.content + div.title {
167 margin-top: 0.0em;
170 div.sidebarblock > div.content {
171 background: #ffffee;
172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
174 padding: 0.5em;
177 div.listingblock > div.content {
178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
181 padding: 0.5em;
184 div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
187 margin-right: 10%;
188 border-left: 5px solid #f0f0f0;
189 color: #888;
192 div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
197 div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
201 div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
205 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
207 text-align: left;
210 div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
218 div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
223 div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
228 div.imageblock div.content { padding-left: 0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
232 dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
236 dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
242 dd > *:first-child {
243 margin-top: 0.1em;
246 ul, ol {
247 list-style-position: outside;
249 ol.arabic {
250 list-style-type: decimal;
252 ol.loweralpha {
253 list-style-type: lower-alpha;
255 ol.upperalpha {
256 list-style-type: upper-alpha;
258 ol.lowerroman {
259 list-style-type: lower-roman;
261 ol.upperroman {
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
272 tfoot {
273 font-weight: bold;
275 td > div.verse {
276 white-space: pre;
279 div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
283 div.hdlist tr {
284 padding-bottom: 15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
289 td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
295 td.hdlist2 {
296 vertical-align: top;
298 div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
303 .comment {
304 background: yellow;
307 .footnote, .footnoteref {
308 font-size: 0.8em;
311 span.footnote, span.footnoteref {
312 vertical-align: super;
315 #footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
320 #footnotes div.footnote {
321 margin: 0 0 5px 0;
324 #footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
334 div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
339 div.colist td img {
340 margin-top: 0.3em;
343 @media print {
344 #footer-badges { display: none; }
347 #toc {
348 margin-bottom: 2.5em;
351 #toctitle {
352 color: #527bbd;
353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
360 margin-top: 0;
361 margin-bottom: 0;
363 div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
367 div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
371 div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size: 2em; }
411 span.small { font-size: 0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
421 * xhtml11 specific
423 * */
425 div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
429 div.tableblock > table {
430 border: 3px solid #527bbd;
432 thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
436 p.table {
437 margin-top: 0;
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock > table[frame="void"] {
441 border-style: none;
443 div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
454 * html5 specific
456 * */
458 table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
462 thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
466 p.tableblock {
467 margin-top: 0;
469 table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
498 th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
501 th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
505 th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
517 * manpage specific
519 * */
521 body.manpage h1 {
522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
527 body.manpage h2 {
528 border-style: none;
530 body.manpage div.sectionbody {
531 margin-left: 3em;
534 @media print {
535 body.manpage div#toc { display: none; }
539 </style>
540 <script type="text/javascript">
541 /*<![CDATA[*/
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
552 * Version: 0.4
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561 // toclevels = 1..4.
562 toc: function (toclevels) {
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
572 return text;
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 iterate(i);
598 iterate(el);
599 return result;
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 entriesToRemove.push(entry);
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
708 install: function(toclevels) {
709 var timerId;
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
731 asciidoc.install();
732 /*]]>*/
733 </script>
734 </head>
735 <body class="manpage">
736 <div id="header">
737 <h1>
738 git-status(1) Manual Page
739 </h1>
740 <h2>NAME</h2>
741 <div class="sectionbody">
742 <p>git-status -
743 Show the working tree status
744 </p>
745 </div>
746 </div>
747 <div id="content">
748 <div class="sect1">
749 <h2 id="_synopsis">SYNOPSIS</h2>
750 <div class="sectionbody">
751 <div class="verseblock">
752 <pre class="content"><em>git status</em> [&lt;options&gt;] [--] [&lt;pathspec&gt;&#8230;]</pre>
753 <div class="attribution">
754 </div></div>
755 </div>
756 </div>
757 <div class="sect1">
758 <h2 id="_description">DESCRIPTION</h2>
759 <div class="sectionbody">
760 <div class="paragraph"><p>Displays paths that have differences between the index file and the
761 current HEAD commit, paths that have differences between the working
762 tree and the index file, and paths in the working tree that are not
763 tracked by Git (and are not ignored by <a href="gitignore.html">gitignore(5)</a>). The first
764 are what you <em>would</em> commit by running <code>git commit</code>; the second and
765 third are what you <em>could</em> commit by running <em>git add</em> before running
766 <code>git commit</code>.</p></div>
767 </div>
768 </div>
769 <div class="sect1">
770 <h2 id="_options">OPTIONS</h2>
771 <div class="sectionbody">
772 <div class="dlist"><dl>
773 <dt class="hdlist1">
775 </dt>
776 <dt class="hdlist1">
777 --short
778 </dt>
779 <dd>
781 Give the output in the short-format.
782 </p>
783 </dd>
784 <dt class="hdlist1">
786 </dt>
787 <dt class="hdlist1">
788 --branch
789 </dt>
790 <dd>
792 Show the branch and tracking info even in short-format.
793 </p>
794 </dd>
795 <dt class="hdlist1">
796 --show-stash
797 </dt>
798 <dd>
800 Show the number of entries currently stashed away.
801 </p>
802 </dd>
803 <dt class="hdlist1">
804 --porcelain[=&lt;version&gt;]
805 </dt>
806 <dd>
808 Give the output in an easy-to-parse format for scripts.
809 This is similar to the short output, but will remain stable
810 across Git versions and regardless of user configuration. See
811 below for details.
812 </p>
813 <div class="paragraph"><p>The version parameter is used to specify the format version.
814 This is optional and defaults to the original version <em>v1</em> format.</p></div>
815 </dd>
816 <dt class="hdlist1">
817 --long
818 </dt>
819 <dd>
821 Give the output in the long-format. This is the default.
822 </p>
823 </dd>
824 <dt class="hdlist1">
826 </dt>
827 <dt class="hdlist1">
828 --verbose
829 </dt>
830 <dd>
832 In addition to the names of files that have been changed, also
833 show the textual changes that are staged to be committed
834 (i.e., like the output of <code>git diff --cached</code>). If <code>-v</code> is specified
835 twice, then also show the changes in the working tree that
836 have not yet been staged (i.e., like the output of <code>git diff</code>).
837 </p>
838 </dd>
839 <dt class="hdlist1">
840 -u[&lt;mode&gt;]
841 </dt>
842 <dt class="hdlist1">
843 --untracked-files[=&lt;mode&gt;]
844 </dt>
845 <dd>
847 Show untracked files.
848 </p>
849 <div class="openblock">
850 <div class="content">
851 <div class="paragraph"><p>The mode parameter is used to specify the handling of untracked files.
852 It is optional: it defaults to <em>all</em>, and if specified, it must be
853 stuck to the option (e.g. <code>-uno</code>, but not <code>-u no</code>).</p></div>
854 <div class="paragraph"><p>The possible options are:</p></div>
855 <div class="ulist"><ul>
856 <li>
858 <em>no</em> - Show no untracked files.
859 </p>
860 </li>
861 <li>
863 <em>normal</em> - Shows untracked files and directories.
864 </p>
865 </li>
866 <li>
868 <em>all</em> - Also shows individual files in untracked directories.
869 </p>
870 </li>
871 </ul></div>
872 <div class="paragraph"><p>When <code>-u</code> option is not used, untracked files and directories are
873 shown (i.e. the same as specifying <code>normal</code>), to help you avoid
874 forgetting to add newly created files. Because it takes extra work
875 to find untracked files in the filesystem, this mode may take some
876 time in a large working tree.
877 Consider enabling untracked cache and split index if supported (see
878 <code>git update-index --untracked-cache</code> and <code>git update-index
879 --split-index</code>), Otherwise you can use <code>no</code> to have <code>git status</code>
880 return more quickly without showing untracked files.
881 All usual spellings for Boolean value <code>true</code> are taken as <code>normal</code>
882 and <code>false</code> as <code>no</code>.</p></div>
883 <div class="paragraph"><p>The default can be changed using the status.showUntrackedFiles
884 configuration variable documented in <a href="git-config.html">git-config(1)</a>.</p></div>
885 </div></div>
886 </dd>
887 <dt class="hdlist1">
888 --ignore-submodules[=&lt;when&gt;]
889 </dt>
890 <dd>
892 Ignore changes to submodules when looking for changes. &lt;when&gt; can be
893 either "none", "untracked", "dirty" or "all", which is the default.
894 Using "none" will consider the submodule modified when it either contains
895 untracked or modified files or its HEAD differs from the commit recorded
896 in the superproject and can be used to override any settings of the
897 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
898 "untracked" is used submodules are not considered dirty when they only
899 contain untracked content (but they are still scanned for modified
900 content). Using "dirty" ignores all changes to the work tree of submodules,
901 only changes to the commits stored in the superproject are shown (this was
902 the behavior before 1.7.0). Using "all" hides all changes to submodules
903 (and suppresses the output of submodule summaries when the config option
904 <code>status.submoduleSummary</code> is set).
905 </p>
906 </dd>
907 <dt class="hdlist1">
908 --ignored[=&lt;mode&gt;]
909 </dt>
910 <dd>
912 Show ignored files as well.
913 </p>
914 <div class="openblock">
915 <div class="content">
916 <div class="paragraph"><p>The mode parameter is used to specify the handling of ignored files.
917 It is optional: it defaults to <em>traditional</em>.</p></div>
918 <div class="paragraph"><p>The possible options are:</p></div>
919 <div class="ulist"><ul>
920 <li>
922 <em>traditional</em> - Shows ignored files and directories, unless
923 --untracked-files=all is specified, in which case
924 individual files in ignored directories are
925 displayed.
926 </p>
927 </li>
928 <li>
930 <em>no</em> - Show no ignored files.
931 </p>
932 </li>
933 <li>
935 <em>matching</em> - Shows ignored files and directories matching an
936 ignore pattern.
937 </p>
938 </li>
939 </ul></div>
940 <div class="paragraph"><p>When <em>matching</em> mode is specified, paths that explicitly match an
941 ignored pattern are shown. If a directory matches an ignore pattern,
942 then it is shown, but not paths contained in the ignored directory. If
943 a directory does not match an ignore pattern, but all contents are
944 ignored, then the directory is not shown, but all contents are shown.</p></div>
945 </div></div>
946 </dd>
947 <dt class="hdlist1">
949 </dt>
950 <dd>
952 Terminate entries with NUL, instead of LF. This implies
953 the <code>--porcelain=v1</code> output format if no other format is given.
954 </p>
955 </dd>
956 <dt class="hdlist1">
957 --column[=&lt;options&gt;]
958 </dt>
959 <dt class="hdlist1">
960 --no-column
961 </dt>
962 <dd>
964 Display untracked files in columns. See configuration variable
965 <code>column.status</code> for option syntax. <code>--column</code> and <code>--no-column</code>
966 without options are equivalent to <em>always</em> and <em>never</em>
967 respectively.
968 </p>
969 </dd>
970 <dt class="hdlist1">
971 --ahead-behind
972 </dt>
973 <dt class="hdlist1">
974 --no-ahead-behind
975 </dt>
976 <dd>
978 Display or do not display detailed ahead/behind counts for the
979 branch relative to its upstream branch. Defaults to true.
980 </p>
981 </dd>
982 <dt class="hdlist1">
983 --renames
984 </dt>
985 <dt class="hdlist1">
986 --no-renames
987 </dt>
988 <dd>
990 Turn on/off rename detection regardless of user configuration.
991 See also <a href="git-diff.html">git-diff(1)</a> <code>--no-renames</code>.
992 </p>
993 </dd>
994 <dt class="hdlist1">
995 --find-renames[=&lt;n&gt;]
996 </dt>
997 <dd>
999 Turn on rename detection, optionally setting the similarity
1000 threshold.
1001 See also <a href="git-diff.html">git-diff(1)</a> <code>--find-renames</code>.
1002 </p>
1003 </dd>
1004 <dt class="hdlist1">
1005 &lt;pathspec&gt;&#8230;
1006 </dt>
1007 <dd>
1009 See the <em>pathspec</em> entry in <a href="gitglossary.html">gitglossary(7)</a>.
1010 </p>
1011 </dd>
1012 </dl></div>
1013 </div>
1014 </div>
1015 <div class="sect1">
1016 <h2 id="_output">OUTPUT</h2>
1017 <div class="sectionbody">
1018 <div class="paragraph"><p>The output from this command is designed to be used as a commit
1019 template comment.
1020 The default, long format, is designed to be human readable,
1021 verbose and descriptive. Its contents and format are subject to change
1022 at any time.</p></div>
1023 <div class="paragraph"><p>The paths mentioned in the output, unlike many other Git commands, are
1024 made relative to the current directory if you are working in a
1025 subdirectory (this is on purpose, to help cutting and pasting). See
1026 the status.relativePaths config option below.</p></div>
1027 <div class="sect2">
1028 <h3 id="_short_format">Short Format</h3>
1029 <div class="paragraph"><p>In the short-format, the status of each path is shown as one of these
1030 forms</p></div>
1031 <div class="literalblock">
1032 <div class="content">
1033 <pre><code>XY PATH
1034 XY ORIG_PATH -&gt; PATH</code></pre>
1035 </div></div>
1036 <div class="paragraph"><p>where <code>ORIG_PATH</code> is where the renamed/copied contents came
1037 from. <code>ORIG_PATH</code> is only shown when the entry is renamed or
1038 copied. The <code>XY</code> is a two-letter status code.</p></div>
1039 <div class="paragraph"><p>The fields (including the <code>-&gt;</code>) are separated from each other by a
1040 single space. If a filename contains whitespace or other nonprintable
1041 characters, that field will be quoted in the manner of a C string
1042 literal: surrounded by ASCII double quote (34) characters, and with
1043 interior special characters backslash-escaped.</p></div>
1044 <div class="paragraph"><p>There are three different types of states that are shown using this format, and
1045 each one uses the <code>XY</code> syntax differently:</p></div>
1046 <div class="ulist"><ul>
1047 <li>
1049 When a merge is occurring and the merge was successful, or outside of a merge
1050 situation, <code>X</code> shows the status of the index and <code>Y</code> shows the status of the
1051 working tree.
1052 </p>
1053 </li>
1054 <li>
1056 When a merge conflict has occurred and has not yet been resolved, <code>X</code> and <code>Y</code>
1057 show the state introduced by each head of the merge, relative to the common
1058 ancestor. These paths are said to be <em>unmerged</em>.
1059 </p>
1060 </li>
1061 <li>
1063 When a path is untracked, <code>X</code> and <code>Y</code> are always the same, since they are
1064 unknown to the index. <code>??</code> is used for untracked paths. Ignored files are
1065 not listed unless <code>--ignored</code> is used; if it is, ignored files are indicated
1066 by <code>!!</code>.
1067 </p>
1068 </li>
1069 </ul></div>
1070 <div class="paragraph"><p>Note that the term <em>merge</em> here also includes rebases using the default
1071 <code>--merge</code> strategy, cherry-picks, and anything else using the merge machinery.</p></div>
1072 <div class="paragraph"><p>In the following table, these three classes are shown in separate sections, and
1073 these characters are used for <code>X</code> and <code>Y</code> fields for the first two sections that
1074 show tracked paths:</p></div>
1075 <div class="ulist"><ul>
1076 <li>
1078 ' ' = unmodified
1079 </p>
1080 </li>
1081 <li>
1083 <em>M</em> = modified
1084 </p>
1085 </li>
1086 <li>
1088 <em>T</em> = file type changed (regular file, symbolic link or submodule)
1089 </p>
1090 </li>
1091 <li>
1093 <em>A</em> = added
1094 </p>
1095 </li>
1096 <li>
1098 <em>D</em> = deleted
1099 </p>
1100 </li>
1101 <li>
1103 <em>R</em> = renamed
1104 </p>
1105 </li>
1106 <li>
1108 <em>C</em> = copied (if config option status.renames is set to "copies")
1109 </p>
1110 </li>
1111 <li>
1113 <em>U</em> = updated but unmerged
1114 </p>
1115 </li>
1116 </ul></div>
1117 <div class="literalblock">
1118 <div class="content">
1119 <pre><code>X Y Meaning
1120 -------------------------------------------------
1121 [AMD] not updated
1122 M [ MTD] updated in index
1123 T [ MTD] type changed in index
1124 A [ MTD] added to index
1125 D deleted from index
1126 R [ MTD] renamed in index
1127 C [ MTD] copied in index
1128 [MTARC] index and work tree matches
1129 [ MTARC] M work tree changed since index
1130 [ MTARC] T type changed in work tree since index
1131 [ MTARC] D deleted in work tree
1132 R renamed in work tree
1133 C copied in work tree
1134 -------------------------------------------------
1135 D D unmerged, both deleted
1136 A U unmerged, added by us
1137 U D unmerged, deleted by them
1138 U A unmerged, added by them
1139 D U unmerged, deleted by us
1140 A A unmerged, both added
1141 U U unmerged, both modified
1142 -------------------------------------------------
1143 ? ? untracked
1144 ! ! ignored
1145 -------------------------------------------------</code></pre>
1146 </div></div>
1147 <div class="paragraph"><p>Submodules have more state and instead report</p></div>
1148 <div class="ulist"><ul>
1149 <li>
1151 <em>M</em> = the submodule has a different HEAD than recorded in the index
1152 </p>
1153 </li>
1154 <li>
1156 <em>m</em> = the submodule has modified content
1157 </p>
1158 </li>
1159 <li>
1161 <em>?</em> = the submodule has untracked files
1162 </p>
1163 </li>
1164 </ul></div>
1165 <div class="paragraph"><p>This is since modified content or untracked files in a submodule cannot be added
1166 via <code>git add</code> in the superproject to prepare a commit.</p></div>
1167 <div class="paragraph"><p><em>m</em> and <em>?</em> are applied recursively. For example if a nested submodule
1168 in a submodule contains an untracked file, this is reported as <em>?</em> as well.</p></div>
1169 <div class="paragraph"><p>If -b is used the short-format status is preceded by a line</p></div>
1170 <div class="literalblock">
1171 <div class="content">
1172 <pre><code>## branchname tracking info</code></pre>
1173 </div></div>
1174 </div>
1175 <div class="sect2">
1176 <h3 id="_porcelain_format_version_1">Porcelain Format Version 1</h3>
1177 <div class="paragraph"><p>Version 1 porcelain format is similar to the short format, but is guaranteed
1178 not to change in a backwards-incompatible way between Git versions or
1179 based on user configuration. This makes it ideal for parsing by scripts.
1180 The description of the short format above also describes the porcelain
1181 format, with a few exceptions:</p></div>
1182 <div class="olist arabic"><ol class="arabic">
1183 <li>
1185 The user&#8217;s color.status configuration is not respected; color will
1186 always be off.
1187 </p>
1188 </li>
1189 <li>
1191 The user&#8217;s status.relativePaths configuration is not respected; paths
1192 shown will always be relative to the repository root.
1193 </p>
1194 </li>
1195 </ol></div>
1196 <div class="paragraph"><p>There is also an alternate -z format recommended for machine parsing. In
1197 that format, the status field is the same, but some other things
1198 change. First, the <em>-&gt;</em> is omitted from rename entries and the field
1199 order is reversed (e.g <em>from -&gt; to</em> becomes <em>to from</em>). Second, a NUL
1200 (ASCII 0) follows each filename, replacing space as a field separator
1201 and the terminating newline (but a space still separates the status
1202 field from the first filename). Third, filenames containing special
1203 characters are not specially formatted; no quoting or
1204 backslash-escaping is performed.</p></div>
1205 <div class="paragraph"><p>Any submodule changes are reported as modified <code>M</code> instead of <code>m</code> or single <code>?</code>.</p></div>
1206 </div>
1207 <div class="sect2">
1208 <h3 id="_porcelain_format_version_2">Porcelain Format Version 2</h3>
1209 <div class="paragraph"><p>Version 2 format adds more detailed information about the state of
1210 the worktree and changed items. Version 2 also defines an extensible
1211 set of easy to parse optional headers.</p></div>
1212 <div class="paragraph"><p>Header lines start with "#" and are added in response to specific
1213 command line arguments. Parsers should ignore headers they
1214 don&#8217;t recognize.</p></div>
1215 <div class="sect3">
1216 <h4 id="_branch_headers">Branch Headers</h4>
1217 <div class="paragraph"><p>If <code>--branch</code> is given, a series of header lines are printed with
1218 information about the current branch.</p></div>
1219 <div class="literalblock">
1220 <div class="content">
1221 <pre><code>Line Notes
1222 ------------------------------------------------------------
1223 # branch.oid &lt;commit&gt; | (initial) Current commit.
1224 # branch.head &lt;branch&gt; | (detached) Current branch.
1225 # branch.upstream &lt;upstream-branch&gt; If upstream is set.
1226 # branch.ab +&lt;ahead&gt; -&lt;behind&gt; If upstream is set and
1227 the commit is present.
1228 ------------------------------------------------------------</code></pre>
1229 </div></div>
1230 </div>
1231 <div class="sect3">
1232 <h4 id="_stash_information">Stash Information</h4>
1233 <div class="paragraph"><p>If <code>--show-stash</code> is given, one line is printed showing the number of stash
1234 entries if non-zero:</p></div>
1235 <div class="literalblock">
1236 <div class="content">
1237 <pre><code># stash &lt;N&gt;</code></pre>
1238 </div></div>
1239 </div>
1240 <div class="sect3">
1241 <h4 id="_changed_tracked_entries">Changed Tracked Entries</h4>
1242 <div class="paragraph"><p>Following the headers, a series of lines are printed for tracked
1243 entries. One of three different line formats may be used to describe
1244 an entry depending on the type of change. Tracked entries are printed
1245 in an undefined order; parsers should allow for a mixture of the 3
1246 line types in any order.</p></div>
1247 <div class="paragraph"><p>Ordinary changed entries have the following format:</p></div>
1248 <div class="literalblock">
1249 <div class="content">
1250 <pre><code>1 &lt;XY&gt; &lt;sub&gt; &lt;mH&gt; &lt;mI&gt; &lt;mW&gt; &lt;hH&gt; &lt;hI&gt; &lt;path&gt;</code></pre>
1251 </div></div>
1252 <div class="paragraph"><p>Renamed or copied entries have the following format:</p></div>
1253 <div class="literalblock">
1254 <div class="content">
1255 <pre><code>2 &lt;XY&gt; &lt;sub&gt; &lt;mH&gt; &lt;mI&gt; &lt;mW&gt; &lt;hH&gt; &lt;hI&gt; &lt;X&gt;&lt;score&gt; &lt;path&gt;&lt;sep&gt;&lt;origPath&gt;</code></pre>
1256 </div></div>
1257 <div class="literalblock">
1258 <div class="content">
1259 <pre><code>Field Meaning
1260 --------------------------------------------------------
1261 &lt;XY&gt; A 2 character field containing the staged and
1262 unstaged XY values described in the short format,
1263 with unchanged indicated by a "." rather than
1264 a space.
1265 &lt;sub&gt; A 4 character field describing the submodule state.
1266 "N..." when the entry is not a submodule.
1267 "S&lt;c&gt;&lt;m&gt;&lt;u&gt;" when the entry is a submodule.
1268 &lt;c&gt; is "C" if the commit changed; otherwise ".".
1269 &lt;m&gt; is "M" if it has tracked changes; otherwise ".".
1270 &lt;u&gt; is "U" if there are untracked changes; otherwise ".".
1271 &lt;mH&gt; The octal file mode in HEAD.
1272 &lt;mI&gt; The octal file mode in the index.
1273 &lt;mW&gt; The octal file mode in the worktree.
1274 &lt;hH&gt; The object name in HEAD.
1275 &lt;hI&gt; The object name in the index.
1276 &lt;X&gt;&lt;score&gt; The rename or copy score (denoting the percentage
1277 of similarity between the source and target of the
1278 move or copy). For example "R100" or "C75".
1279 &lt;path&gt; The pathname. In a renamed/copied entry, this
1280 is the target path.
1281 &lt;sep&gt; When the `-z` option is used, the 2 pathnames are separated
1282 with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)
1283 byte separates them.
1284 &lt;origPath&gt; The pathname in the commit at HEAD or in the index.
1285 This is only present in a renamed/copied entry, and
1286 tells where the renamed/copied contents came from.
1287 --------------------------------------------------------</code></pre>
1288 </div></div>
1289 <div class="paragraph"><p>Unmerged entries have the following format; the first character is
1290 a "u" to distinguish from ordinary changed entries.</p></div>
1291 <div class="literalblock">
1292 <div class="content">
1293 <pre><code>u &lt;XY&gt; &lt;sub&gt; &lt;m1&gt; &lt;m2&gt; &lt;m3&gt; &lt;mW&gt; &lt;h1&gt; &lt;h2&gt; &lt;h3&gt; &lt;path&gt;</code></pre>
1294 </div></div>
1295 <div class="literalblock">
1296 <div class="content">
1297 <pre><code>Field Meaning
1298 --------------------------------------------------------
1299 &lt;XY&gt; A 2 character field describing the conflict type
1300 as described in the short format.
1301 &lt;sub&gt; A 4 character field describing the submodule state
1302 as described above.
1303 &lt;m1&gt; The octal file mode in stage 1.
1304 &lt;m2&gt; The octal file mode in stage 2.
1305 &lt;m3&gt; The octal file mode in stage 3.
1306 &lt;mW&gt; The octal file mode in the worktree.
1307 &lt;h1&gt; The object name in stage 1.
1308 &lt;h2&gt; The object name in stage 2.
1309 &lt;h3&gt; The object name in stage 3.
1310 &lt;path&gt; The pathname.
1311 --------------------------------------------------------</code></pre>
1312 </div></div>
1313 </div>
1314 <div class="sect3">
1315 <h4 id="_other_items">Other Items</h4>
1316 <div class="paragraph"><p>Following the tracked entries (and if requested), a series of
1317 lines will be printed for untracked and then ignored items
1318 found in the worktree.</p></div>
1319 <div class="paragraph"><p>Untracked items have the following format:</p></div>
1320 <div class="literalblock">
1321 <div class="content">
1322 <pre><code>? &lt;path&gt;</code></pre>
1323 </div></div>
1324 <div class="paragraph"><p>Ignored items have the following format:</p></div>
1325 <div class="literalblock">
1326 <div class="content">
1327 <pre><code>! &lt;path&gt;</code></pre>
1328 </div></div>
1329 </div>
1330 <div class="sect3">
1331 <h4 id="_pathname_format_notes_and_z">Pathname Format Notes and -z</h4>
1332 <div class="paragraph"><p>When the <code>-z</code> option is given, pathnames are printed as is and
1333 without any quoting and lines are terminated with a NUL (ASCII 0x00)
1334 byte.</p></div>
1335 <div class="paragraph"><p>Without the <code>-z</code> option, pathnames with "unusual" characters are
1336 quoted as explained for the configuration variable <code>core.quotePath</code>
1337 (see <a href="git-config.html">git-config(1)</a>).</p></div>
1338 </div>
1339 </div>
1340 </div>
1341 </div>
1342 <div class="sect1">
1343 <h2 id="_configuration">CONFIGURATION</h2>
1344 <div class="sectionbody">
1345 <div class="paragraph"><p>The command honors <code>color.status</code> (or <code>status.color</code>&#8201;&#8212;&#8201;they
1346 mean the same thing and the latter is kept for backward
1347 compatibility) and <code>color.status.&lt;slot&gt;</code> configuration variables
1348 to colorize its output.</p></div>
1349 <div class="paragraph"><p>If the config variable <code>status.relativePaths</code> is set to false, then all
1350 paths shown are relative to the repository root, not to the current
1351 directory.</p></div>
1352 <div class="paragraph"><p>If <code>status.submoduleSummary</code> is set to a non zero number or true (identical
1353 to -1 or an unlimited number), the submodule summary will be enabled for
1354 the long format and a summary of commits for modified submodules will be
1355 shown (see --summary-limit option of <a href="git-submodule.html">git-submodule(1)</a>). Please note
1356 that the summary output from the status command will be suppressed for all
1357 submodules when <code>diff.ignoreSubmodules</code> is set to <em>all</em> or only for those
1358 submodules where <code>submodule.&lt;name&gt;.ignore=all</code>. To also view the summary for
1359 ignored submodules you can either use the --ignore-submodules=dirty command
1360 line option or the <em>git submodule summary</em> command, which shows a similar
1361 output but does not honor these settings.</p></div>
1362 </div>
1363 </div>
1364 <div class="sect1">
1365 <h2 id="_background_refresh">BACKGROUND REFRESH</h2>
1366 <div class="sectionbody">
1367 <div class="paragraph"><p>By default, <code>git status</code> will automatically refresh the index, updating
1368 the cached stat information from the working tree and writing out the
1369 result. Writing out the updated index is an optimization that isn&#8217;t
1370 strictly necessary (<code>status</code> computes the values for itself, but writing
1371 them out is just to save subsequent programs from repeating our
1372 computation). When <code>status</code> is run in the background, the lock held
1373 during the write may conflict with other simultaneous processes, causing
1374 them to fail. Scripts running <code>status</code> in the background should consider
1375 using <code>git --no-optional-locks status</code> (see <a href="git.html">git(1)</a> for details).</p></div>
1376 </div>
1377 </div>
1378 <div class="sect1">
1379 <h2 id="_untracked_files_and_performance">UNTRACKED FILES AND PERFORMANCE</h2>
1380 <div class="sectionbody">
1381 <div class="paragraph"><p><code>git status</code> can be very slow in large worktrees if/when it
1382 needs to search for untracked files and directories. There are
1383 many configuration options available to speed this up by either
1384 avoiding the work or making use of cached results from previous
1385 Git commands. There is no single optimum set of settings right
1386 for everyone. We&#8217;ll list a summary of the relevant options to help
1387 you, but before going into the list, you may want to run <code>git status</code>
1388 again, because your configuration may already be caching <code>git status</code>
1389 results, so it could be faster on subsequent runs.</p></div>
1390 <div class="ulist"><ul>
1391 <li>
1393 The <code>--untracked-files=no</code> flag or the
1394 <code>status.showUntrackedFiles=no</code> config (see above for both):
1395 indicate that <code>git status</code> should not report untracked
1396 files. This is the fastest option. <code>git status</code> will not list
1397 the untracked files, so you need to be careful to remember if
1398 you create any new files and manually <code>git add</code> them.
1399 </p>
1400 </li>
1401 <li>
1403 <code>advice.statusUoption=false</code> (see <a href="git-config.html">git-config(1)</a>):
1404 setting this variable to <code>false</code> disables the warning message
1405 given when enumerating untracked files takes more than 2
1406 seconds. In a large project, it may take longer and the user
1407 may have already accepted the trade off (e.g. using "-uno" may
1408 not be an acceptable option for the user), in which case, there
1409 is no point issuing the warning message, and in such a case,
1410 disabling the warning may be the best.
1411 </p>
1412 </li>
1413 <li>
1415 <code>core.untrackedCache=true</code> (see <a href="git-update-index.html">git-update-index(1)</a>):
1416 enable the untracked cache feature and only search directories
1417 that have been modified since the previous <code>git status</code> command.
1418 Git remembers the set of untracked files within each directory
1419 and assumes that if a directory has not been modified, then
1420 the set of untracked files within has not changed. This is much
1421 faster than enumerating the contents of every directory, but still
1422 not without cost, because Git still has to search for the set of
1423 modified directories. The untracked cache is stored in the
1424 <code>.git/index</code> file. The reduced cost of searching for untracked
1425 files is offset slightly by the increased size of the index and
1426 the cost of keeping it up-to-date. That reduced search time is
1427 usually worth the additional size.
1428 </p>
1429 </li>
1430 <li>
1432 <code>core.untrackedCache=true</code> and <code>core.fsmonitor=true</code> or
1433 <code>core.fsmonitor=&lt;hook-command-pathname&gt;</code> (see
1434 <a href="git-update-index.html">git-update-index(1)</a>): enable both the untracked cache
1435 and FSMonitor features and only search directories that have
1436 been modified since the previous <code>git status</code> command. This
1437 is faster than using just the untracked cache alone because
1438 Git can also avoid searching for modified directories. Git
1439 only has to enumerate the exact set of directories that have
1440 changed recently. While the FSMonitor feature can be enabled
1441 without the untracked cache, the benefits are greatly reduced
1442 in that case.
1443 </p>
1444 </li>
1445 </ul></div>
1446 <div class="paragraph"><p>Note that after you turn on the untracked cache and/or FSMonitor
1447 features it may take a few <code>git status</code> commands for the various
1448 caches to warm up before you see improved command times. This is
1449 normal.</p></div>
1450 </div>
1451 </div>
1452 <div class="sect1">
1453 <h2 id="_see_also">SEE ALSO</h2>
1454 <div class="sectionbody">
1455 <div class="paragraph"><p><a href="gitignore.html">gitignore(5)</a></p></div>
1456 </div>
1457 </div>
1458 <div class="sect1">
1459 <h2 id="_git">GIT</h2>
1460 <div class="sectionbody">
1461 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1462 </div>
1463 </div>
1464 </div>
1465 <div id="footnotes"><hr /></div>
1466 <div id="footer">
1467 <div id="footer-text">
1468 Last updated
1469 2024-03-28 14:36:08 PDT
1470 </div>
1471 </div>
1472 </body>
1473 </html>