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">
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 */
14 font-family: Georgia,serif;
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
22 #author, #revnumber, #revdate, #revremark,
24 font-family: Arial,Helvetica,sans-serif;
28 margin:
1em
5%
1em
5%;
33 text-decoration: underline;
49 h1, h2, h3, h4, h5, h6 {
57 border-bottom:
2px solid silver;
77 border:
1px solid silver;
88 ul
> li { color: #aaa; }
89 ul
> li
> * { color: black; }
91 .monospaced, code, pre {
92 font-family:
"Courier New", Courier, monospace;
99 white-space: pre-wrap;
109 #revnumber, #revdate, #revremark {
114 border-top:
2px solid silver;
120 padding-bottom:
0.5em;
124 padding-bottom:
0.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 {
135 margin-bottom:
1.5em;
137 div.admonitionblock {
139 margin-bottom:
2.0em;
144 div.content { /* Block element content. */
148 /* Block element titles. */
149 div.title, caption.title {
154 margin-bottom:
0.5em;
160 td div.title:first-child {
163 div.content div.title:first-child {
166 div.content + div.title {
170 div.sidebarblock
> div.content {
172 border:
1px solid #dddddd;
173 border-left:
4px solid #f0f0f0;
177 div.listingblock
> div.content {
178 border:
1px solid #dddddd;
179 border-left:
5px solid #f0f0f0;
184 div.quoteblock, div.verseblock {
188 border-left:
5px solid #f0f0f0;
192 div.quoteblock
> div.attribution {
197 div.verseblock
> pre.content {
198 font-family: inherit;
201 div.verseblock
> div.attribution {
205 /* DEPRECATED: Pre version
8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
210 div.admonitionblock .icon {
214 text-decoration: underline;
216 padding-right:
0.5em;
218 div.admonitionblock td.content {
220 border-left:
3px solid #dddddd;
223 div.exampleblock
> div.content {
224 border-left:
3px solid #dddddd;
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; }
234 margin-bottom:
0.8em;
247 list-style-position: outside;
250 list-style-type: decimal;
253 list-style-type: lower-alpha;
256 list-style-type: upper-alpha;
259 list-style-type: lower-roman;
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 {
269 margin-bottom:
0.1em;
281 margin-bottom:
0.8em;
284 padding-bottom:
15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
292 padding-right:
0.8em;
298 div.hdlist.compact tr {
307 .footnote, .footnoteref {
311 span.footnote, span.footnoteref {
312 vertical-align: super;
316 margin:
20px
0 20px
0;
320 #footnotes div.footnote {
326 border-top:
1px solid silver;
335 padding-right:
0.5em;
336 padding-bottom:
0.3em;
344 #footer-badges { display: none; }
348 margin-bottom:
2.5em;
356 margin-bottom:
0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
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; }
427 margin-bottom:
1.5em;
429 div.tableblock
> table {
430 border:
3px solid #
527bbd;
432 thead, p.table.header {
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock
> table[
frame=
"void"] {
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;
460 margin-bottom:
1.5em;
462 thead, p.tableblock.header {
473 border-color: #
527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
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 {
498 th.tableblock.halign-center, td.tableblock.halign-center {
501 th.tableblock.halign-right, td.tableblock.halign-right {
505 th.tableblock.valign-top, td.tableblock.valign-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;
523 padding-bottom:
0.5em;
524 border-top:
2px solid silver;
525 border-bottom:
2px solid silver;
530 body.manpage div.sectionbody {
535 body.manpage div#toc { display: none; }
540 <script type=
"text/javascript">
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
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 */
562 toc: function (toclevels) {
564 function getText(el) {
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType ==
3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 else if (i.firstChild != null)
575 function TocEntry(el, text, toclevel) {
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
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);
602 var toc = document.getElementById(
"toc");
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
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");
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.
651 var noteholder = document.getElementById(
"footnotes");
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");
670 for (i=
0; i
<spans.length; i++) {
671 if (spans[i].className ==
"footnote") {
673 var note = spans[i].getAttribute(
"data-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];
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;
692 noteholder.parentNode.removeChild(noteholder);
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.
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n +
"</a>]";
708 install: function(toclevels) {
711 function reinstall() {
712 asciidoc.footnotes();
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
723 timerId = setInterval(reinstall,
500);
724 if (document.addEventListener)
725 document.addEventListener(
"DOMContentLoaded", reinstallAndRemoveTimer, false);
727 window.onload = reinstallAndRemoveTimer;
735 <body class=
"manpage">
738 git-status(
1) Manual Page
741 <div class=
"sectionbody">
743 Show the working tree status
749 <h2 id=
"_synopsis">SYNOPSIS
</h2>
750 <div class=
"sectionbody">
751 <div class=
"verseblock">
752 <pre class=
"content"><em>git status
</em> [
<options
>] [--] [
<pathspec
>…]
</pre>
753 <div class=
"attribution">
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>
770 <h2 id=
"_options">OPTIONS
</h2>
771 <div class=
"sectionbody">
772 <div class=
"dlist"><dl>
781 Give the output in the short-format.
792 Show the branch and tracking info even in short-format.
800 Show the number of entries currently stashed away.
804 --porcelain[=
<version
>]
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
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>
821 Give the output in the long-format. This is the default.
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>).
843 --untracked-files[=
<mode
>]
847 Show untracked files.
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>
858 <em>no
</em> - Show no untracked files.
863 <em>normal
</em> - Shows untracked files and directories.
868 <em>all
</em> - Also shows individual files in untracked directories.
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>
888 --ignore-submodules[=
<when
>]
892 Ignore changes to submodules when looking for changes.
<when
> 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).
908 --ignored[=
<mode
>]
912 Show ignored files as well.
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>
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
930 <em>no
</em> - Show no ignored files.
935 <em>matching
</em> - Shows ignored files and directories matching an
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>
952 Terminate entries with NUL, instead of LF. This implies
953 the
<code>--porcelain=v1
</code> output format if no other format is given.
957 --column[=
<options
>]
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>
978 Display or do not display detailed ahead/behind counts for the
979 branch relative to its upstream branch. Defaults to true.
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>.
995 --find-renames[=
<n
>]
999 Turn on rename detection, optionally setting the similarity
1001 See also
<a href=
"git-diff.html">git-diff(
1)
</a> <code>--find-renames
</code>.
1004 <dt class=
"hdlist1">
1005 <pathspec
>…
1009 See the
<em>pathspec
</em> entry in
<a href=
"gitglossary.html">gitglossary(
7)
</a>.
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
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>
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
1031 <div class=
"literalblock">
1032 <div class=
"content">
1034 XY ORIG_PATH -
> PATH
</code></pre>
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>-
></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>
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
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>.
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
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>
1083 <em>M
</em> = modified
1088 <em>T
</em> = file type changed (regular file, symbolic link or submodule)
1098 <em>D
</em> = deleted
1103 <em>R
</em> = renamed
1108 <em>C
</em> = copied (if config option status.renames is set to
"copies")
1113 <em>U
</em> = updated but unmerged
1117 <div class=
"literalblock">
1118 <div class=
"content">
1119 <pre><code>X Y Meaning
1120 -------------------------------------------------
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 -------------------------------------------------
1145 -------------------------------------------------
</code></pre>
1147 <div class=
"paragraph"><p>Submodules have more state and instead report
</p></div>
1148 <div class=
"ulist"><ul>
1151 <em>M
</em> = the submodule has a different HEAD than recorded in the index
1156 <em>m
</em> = the submodule has modified content
1161 <em>?
</em> = the submodule has untracked files
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>
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">
1185 The user
’s color.status configuration is not respected; color will
1191 The user
’s status.relativePaths configuration is not respected; paths
1192 shown will always be relative to the repository root.
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>-
></em> is omitted from rename entries and the field
1199 order is reversed (e.g
<em>from -
> 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>
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
’t recognize.
</p></div>
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
<commit
> | (initial) Current commit.
1224 # branch.head
<branch
> | (detached) Current branch.
1225 # branch.upstream
<upstream-branch
> If upstream is set.
1226 # branch.ab +
<ahead
> -
<behind
> If upstream is set and
1227 the commit is present.
1228 ------------------------------------------------------------
</code></pre>
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
<N
></code></pre>
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 <XY
> <sub
> <mH
> <mI
> <mW
> <hH
> <hI
> <path
></code></pre>
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 <XY
> <sub
> <mH
> <mI
> <mW
> <hH
> <hI
> <X
><score
> <path
><sep
><origPath
></code></pre>
1257 <div class=
"literalblock">
1258 <div class=
"content">
1259 <pre><code>Field Meaning
1260 --------------------------------------------------------
1261 <XY
> 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
1265 <sub
> A
4 character field describing the submodule state.
1266 "N..." when the entry is not a submodule.
1267 "S<c><m><u>" when the entry is a submodule.
1268 <c
> is
"C" if the commit changed; otherwise
".".
1269 <m
> is
"M" if it has tracked changes; otherwise
".".
1270 <u
> is
"U" if there are untracked changes; otherwise
".".
1271 <mH
> The octal file mode in HEAD.
1272 <mI
> The octal file mode in the index.
1273 <mW
> The octal file mode in the worktree.
1274 <hH
> The object name in HEAD.
1275 <hI
> The object name in the index.
1276 <X
><score
> 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 <path
> The pathname. In a renamed/copied entry, this
1281 <sep
> 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 <origPath
> 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>
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
<XY
> <sub
> <m1
> <m2
> <m3
> <mW
> <h1
> <h2
> <h3
> <path
></code></pre>
1295 <div class=
"literalblock">
1296 <div class=
"content">
1297 <pre><code>Field Meaning
1298 --------------------------------------------------------
1299 <XY
> A
2 character field describing the conflict type
1300 as described in the short format.
1301 <sub
> A
4 character field describing the submodule state
1303 <m1
> The octal file mode in stage
1.
1304 <m2
> The octal file mode in stage
2.
1305 <m3
> The octal file mode in stage
3.
1306 <mW
> The octal file mode in the worktree.
1307 <h1
> The object name in stage
1.
1308 <h2
> The object name in stage
2.
1309 <h3
> The object name in stage
3.
1310 <path
> The pathname.
1311 --------------------------------------------------------
</code></pre>
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>?
<path
></code></pre>
1324 <div class=
"paragraph"><p>Ignored items have the following format:
</p></div>
1325 <div class=
"literalblock">
1326 <div class=
"content">
1327 <pre><code>!
<path
></code></pre>
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)
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>
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> — they
1346 mean the same thing and the latter is kept for backward
1347 compatibility) and
<code>color.status.
<slot
></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.
<name
>.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>
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
’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>
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
’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>
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.
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.
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.
1432 <code>core.untrackedCache=true
</code> and
<code>core.fsmonitor=true
</code> or
1433 <code>core.fsmonitor=
<hook-command-pathname
></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
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
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>
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>
1465 <div id=
"footnotes"><hr /></div>
1467 <div id=
"footer-text">
1469 2024-
03-
28 14:
36:
08 PDT