Server IP : 184.154.167.98 / Your IP : 18.189.194.36 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/git/ |
Upload File : |
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> <meta name="generator" content="AsciiDoc 8.6.10" /> <title>git-status(1)</title> <style type="text/css"> /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ /* Default font. */ body { font-family: Georgia,serif; } /* Title font. */ h1, h2, h3, h4, h5, h6, div.title, caption.title, thead, p.table.header, #toctitle, #author, #revnumber, #revdate, #revremark, #footer { font-family: Arial,Helvetica,sans-serif; } body { margin: 1em 5% 1em 5%; } a { color: blue; text-decoration: underline; } a:visited { color: fuchsia; } em { font-style: italic; color: navy; } strong { font-weight: bold; color: #083194; } h1, h2, h3, h4, h5, h6 { color: #527bbd; margin-top: 1.2em; margin-bottom: 0.5em; line-height: 1.3; } h1, h2, h3 { border-bottom: 2px solid silver; } h2 { padding-top: 0.5em; } h3 { float: left; } h3 + * { clear: left; } h5 { font-size: 1.0em; } div.sectionbody { margin-left: 0; } hr { border: 1px solid silver; } p { margin-top: 0.5em; margin-bottom: 0.5em; } ul, ol, li > p { margin-top: 0; } ul > li { color: #aaa; } ul > li > * { color: black; } .monospaced, code, pre { font-family: "Courier New", Courier, monospace; font-size: inherit; color: navy; padding: 0; margin: 0; } pre { white-space: pre-wrap; } #author { color: #527bbd; font-weight: bold; font-size: 1.1em; } #email { } #revnumber, #revdate, #revremark { } #footer { font-size: small; border-top: 2px solid silver; padding-top: 0.5em; margin-top: 4.0em; } #footer-text { float: left; padding-bottom: 0.5em; } #footer-badges { float: right; padding-bottom: 0.5em; } #preamble { margin-top: 1.5em; margin-bottom: 1.5em; } div.imageblock, div.exampleblock, div.verseblock, div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, div.admonitionblock { margin-top: 1.0em; margin-bottom: 1.5em; } div.admonitionblock { margin-top: 2.0em; margin-bottom: 2.0em; margin-right: 10%; color: #606060; } div.content { /* Block element content. */ padding: 0; } /* Block element titles. */ div.title, caption.title { color: #527bbd; font-weight: bold; text-align: left; margin-top: 1.0em; margin-bottom: 0.5em; } div.title + * { margin-top: 0; } td div.title:first-child { margin-top: 0.0em; } div.content div.title:first-child { margin-top: 0.0em; } div.content + div.title { margin-top: 0.0em; } div.sidebarblock > div.content { background: #ffffee; border: 1px solid #dddddd; border-left: 4px solid #f0f0f0; padding: 0.5em; } div.listingblock > div.content { border: 1px solid #dddddd; border-left: 5px solid #f0f0f0; background: #f8f8f8; padding: 0.5em; } div.quoteblock, div.verseblock { padding-left: 1.0em; margin-left: 1.0em; margin-right: 10%; border-left: 5px solid #f0f0f0; color: #888; } div.quoteblock > div.attribution { padding-top: 0.5em; text-align: right; } div.verseblock > pre.content { font-family: inherit; font-size: inherit; } div.verseblock > div.attribution { padding-top: 0.75em; text-align: left; } /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ div.verseblock + div.attribution { text-align: left; } div.admonitionblock .icon { vertical-align: top; font-size: 1.1em; font-weight: bold; text-decoration: underline; color: #527bbd; padding-right: 0.5em; } div.admonitionblock td.content { padding-left: 0.5em; border-left: 3px solid #dddddd; } div.exampleblock > div.content { border-left: 3px solid #dddddd; padding-left: 0.5em; } div.imageblock div.content { padding-left: 0; } span.image img { border-style: none; vertical-align: text-bottom; } a.image:visited { color: white; } dl { margin-top: 0.8em; margin-bottom: 0.8em; } dt { margin-top: 0.5em; margin-bottom: 0; font-style: normal; color: navy; } dd > *:first-child { margin-top: 0.1em; } ul, ol { list-style-position: outside; } ol.arabic { list-style-type: decimal; } ol.loweralpha { list-style-type: lower-alpha; } ol.upperalpha { list-style-type: upper-alpha; } ol.lowerroman { list-style-type: lower-roman; } ol.upperroman { list-style-type: upper-roman; } div.compact ul, div.compact ol, div.compact p, div.compact p, div.compact div, div.compact div { margin-top: 0.1em; margin-bottom: 0.1em; } tfoot { font-weight: bold; } td > div.verse { white-space: pre; } div.hdlist { margin-top: 0.8em; margin-bottom: 0.8em; } div.hdlist tr { padding-bottom: 15px; } dt.hdlist1.strong, td.hdlist1.strong { font-weight: bold; } td.hdlist1 { vertical-align: top; font-style: normal; padding-right: 0.8em; color: navy; } td.hdlist2 { vertical-align: top; } div.hdlist.compact tr { margin: 0; padding-bottom: 0; } .comment { background: yellow; } .footnote, .footnoteref { font-size: 0.8em; } span.footnote, span.footnoteref { vertical-align: super; } #footnotes { margin: 20px 0 20px 0; padding: 7px 0 0 0; } #footnotes div.footnote { margin: 0 0 5px 0; } #footnotes hr { border: none; border-top: 1px solid silver; height: 1px; text-align: left; margin-left: 0; width: 20%; min-width: 100px; } div.colist td { padding-right: 0.5em; padding-bottom: 0.3em; vertical-align: top; } div.colist td img { margin-top: 0.3em; } @media print { #footer-badges { display: none; } } #toc { margin-bottom: 2.5em; } #toctitle { color: #527bbd; font-size: 1.1em; font-weight: bold; margin-top: 1.0em; margin-bottom: 0.1em; } div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { margin-top: 0; margin-bottom: 0; } div.toclevel2 { margin-left: 2em; font-size: 0.9em; } div.toclevel3 { margin-left: 4em; font-size: 0.9em; } div.toclevel4 { margin-left: 6em; font-size: 0.9em; } span.aqua { color: aqua; } span.black { color: black; } span.blue { color: blue; } span.fuchsia { color: fuchsia; } span.gray { color: gray; } span.green { color: green; } span.lime { color: lime; } span.maroon { color: maroon; } span.navy { color: navy; } span.olive { color: olive; } span.purple { color: purple; } span.red { color: red; } span.silver { color: silver; } span.teal { color: teal; } span.white { color: white; } span.yellow { color: yellow; } span.aqua-background { background: aqua; } span.black-background { background: black; } span.blue-background { background: blue; } span.fuchsia-background { background: fuchsia; } span.gray-background { background: gray; } span.green-background { background: green; } span.lime-background { background: lime; } span.maroon-background { background: maroon; } span.navy-background { background: navy; } span.olive-background { background: olive; } span.purple-background { background: purple; } span.red-background { background: red; } span.silver-background { background: silver; } span.teal-background { background: teal; } span.white-background { background: white; } span.yellow-background { background: yellow; } span.big { font-size: 2em; } span.small { font-size: 0.6em; } span.underline { text-decoration: underline; } span.overline { text-decoration: overline; } span.line-through { text-decoration: line-through; } div.unbreakable { page-break-inside: avoid; } /* * xhtml11 specific * * */ div.tableblock { margin-top: 1.0em; margin-bottom: 1.5em; } div.tableblock > table { border: 3px solid #527bbd; } thead, p.table.header { font-weight: bold; color: #527bbd; } p.table { margin-top: 0; } /* Because the table frame attribute is overriden by CSS in most browsers. */ div.tableblock > table[frame="void"] { border-style: none; } div.tableblock > table[frame="hsides"] { border-left-style: none; border-right-style: none; } div.tableblock > table[frame="vsides"] { border-top-style: none; border-bottom-style: none; } /* * html5 specific * * */ table.tableblock { margin-top: 1.0em; margin-bottom: 1.5em; } thead, p.tableblock.header { font-weight: bold; color: #527bbd; } p.tableblock { margin-top: 0; } table.tableblock { border-width: 3px; border-spacing: 0px; border-style: solid; border-color: #527bbd; border-collapse: collapse; } th.tableblock, td.tableblock { border-width: 1px; padding: 4px; border-style: solid; border-color: #527bbd; } table.tableblock.frame-topbot { border-left-style: hidden; border-right-style: hidden; } table.tableblock.frame-sides { border-top-style: hidden; border-bottom-style: hidden; } table.tableblock.frame-none { border-style: hidden; } th.tableblock.halign-left, td.tableblock.halign-left { text-align: left; } th.tableblock.halign-center, td.tableblock.halign-center { text-align: center; } th.tableblock.halign-right, td.tableblock.halign-right { text-align: right; } th.tableblock.valign-top, td.tableblock.valign-top { vertical-align: top; } th.tableblock.valign-middle, td.tableblock.valign-middle { vertical-align: middle; } th.tableblock.valign-bottom, td.tableblock.valign-bottom { vertical-align: bottom; } /* * manpage specific * * */ body.manpage h1 { padding-top: 0.5em; padding-bottom: 0.5em; border-top: 2px solid silver; border-bottom: 2px solid silver; } body.manpage h2 { border-style: none; } body.manpage div.sectionbody { margin-left: 3em; } @media print { body.manpage div#toc { display: none; } } </style> <script type="text/javascript"> /*<![CDATA[*/ var asciidoc = { // Namespace. ///////////////////////////////////////////////////////////////////// // Table Of Contents generator ///////////////////////////////////////////////////////////////////// /* Author: Mihai Bazon, September 2002 * http://students.infoiasi.ro/~mishoo * * Table Of Content generator * Version: 0.4 * * Feel free to use this script under the terms of the GNU General Public * License, as long as you do not remove or alter this notice. */ /* modified by Troy D. Hanson, September 2006. License: GPL */ /* modified by Stuart Rackham, 2006, 2009. License: GPL */ // toclevels = 1..4. toc: function (toclevels) { function getText(el) { var text = ""; for (var i = el.firstChild; i != null; i = i.nextSibling) { if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. text += i.data; else if (i.firstChild != null) text += getText(i); } return text; } function TocEntry(el, text, toclevel) { this.element = el; this.text = text; this.toclevel = toclevel; } function tocEntries(el, toclevels) { var result = new Array; var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); // Function that scans the DOM tree for header elements (the DOM2 // nodeIterator API would be a better technique but not supported by all // browsers). var iterate = function (el) { for (var i = el.firstChild; i != null; i = i.nextSibling) { if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { var mo = re.exec(i.tagName); if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { result[result.length] = new TocEntry(i, getText(i), mo[1]-1); } iterate(i); } } } iterate(el); return result; } var toc = document.getElementById("toc"); if (!toc) { return; } // Delete existing TOC entries in case we're reloading the TOC. var tocEntriesToRemove = []; var i; for (i = 0; i < toc.childNodes.length; i++) { var entry = toc.childNodes[i]; if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") && entry.getAttribute("class").match(/^toclevel/)) tocEntriesToRemove.push(entry); } for (i = 0; i < tocEntriesToRemove.length; i++) { toc.removeChild(tocEntriesToRemove[i]); } // Rebuild TOC entries. var entries = tocEntries(document.getElementById("content"), toclevels); for (var i = 0; i < entries.length; ++i) { var entry = entries[i]; if (entry.element.id == "") entry.element.id = "_toc_" + i; var a = document.createElement("a"); a.href = "#" + entry.element.id; a.appendChild(document.createTextNode(entry.text)); var div = document.createElement("div"); div.appendChild(a); div.className = "toclevel" + entry.toclevel; toc.appendChild(div); } if (entries.length == 0) toc.parentNode.removeChild(toc); }, ///////////////////////////////////////////////////////////////////// // Footnotes generator ///////////////////////////////////////////////////////////////////// /* Based on footnote generation code from: * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html */ footnotes: function () { // Delete existing footnote entries in case we're reloading the footnodes. var i; var noteholder = document.getElementById("footnotes"); if (!noteholder) { return; } var entriesToRemove = []; for (i = 0; i < noteholder.childNodes.length; i++) { var entry = noteholder.childNodes[i]; if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") entriesToRemove.push(entry); } for (i = 0; i < entriesToRemove.length; i++) { noteholder.removeChild(entriesToRemove[i]); } // Rebuild footnote entries. var cont = document.getElementById("content"); var spans = cont.getElementsByTagName("span"); var refs = {}; var n = 0; for (i=0; i<spans.length; i++) { if (spans[i].className == "footnote") { n++; var note = spans[i].getAttribute("data-note"); if (!note) { // Use [\s\S] in place of . so multi-line matches work. // Because JavaScript has no s (dotall) regex flag. note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; spans[i].innerHTML = "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + "' title='View footnote' class='footnote'>" + n + "</a>]"; spans[i].setAttribute("data-note", note); } noteholder.innerHTML += "<div class='footnote' id='_footnote_" + n + "'>" + "<a href='#_footnoteref_" + n + "' title='Return to text'>" + n + "</a>. " + note + "</div>"; var id =spans[i].getAttribute("id"); if (id != null) refs["#"+id] = n; } } if (n == 0) noteholder.parentNode.removeChild(noteholder); else { // Process footnoterefs. for (i=0; i<spans.length; i++) { if (spans[i].className == "footnoteref") { var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); href = href.match(/#.*/)[0]; // Because IE return full URL. n = refs[href]; spans[i].innerHTML = "[<a href='#_footnote_" + n + "' title='View footnote' class='footnote'>" + n + "</a>]"; } } } }, install: function(toclevels) { var timerId; function reinstall() { asciidoc.footnotes(); if (toclevels) { asciidoc.toc(toclevels); } } function reinstallAndRemoveTimer() { clearInterval(timerId); reinstall(); } timerId = setInterval(reinstall, 500); if (document.addEventListener) document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); else window.onload = reinstallAndRemoveTimer; } } asciidoc.install(); /*]]>*/ </script> </head> <body class="manpage"> <div id="header"> <h1> git-status(1) Manual Page </h1> <h2>NAME</h2> <div class="sectionbody"> <p>git-status - Show the working tree status </p> </div> </div> <div id="content"> <div class="sect1"> <h2 id="_synopsis">SYNOPSIS</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content"><em>git status</em> [<options>] [--] [<pathspec>…]</pre> <div class="attribution"> </div></div> </div> </div> <div class="sect1"> <h2 id="_description">DESCRIPTION</h2> <div class="sectionbody"> <div class="paragraph"><p>Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in the working tree that are not tracked by Git (and are not ignored by <a href="gitignore.html">gitignore(5)</a>). The first are what you <em>would</em> commit by running <code>git commit</code>; the second and third are what you <em>could</em> commit by running <em>git add</em> before running <code>git commit</code>.</p></div> </div> </div> <div class="sect1"> <h2 id="_options">OPTIONS</h2> <div class="sectionbody"> <div class="dlist"><dl> <dt class="hdlist1"> -s </dt> <dt class="hdlist1"> --short </dt> <dd> <p> Give the output in the short-format. </p> </dd> <dt class="hdlist1"> -b </dt> <dt class="hdlist1"> --branch </dt> <dd> <p> Show the branch and tracking info even in short-format. </p> </dd> <dt class="hdlist1"> --show-stash </dt> <dd> <p> Show the number of entries currently stashed away. </p> </dd> <dt class="hdlist1"> --porcelain[=<version>] </dt> <dd> <p> Give the output in an easy-to-parse format for scripts. This is similar to the short output, but will remain stable across Git versions and regardless of user configuration. See below for details. </p> <div class="paragraph"><p>The version parameter is used to specify the format version. This is optional and defaults to the original version <em>v1</em> format.</p></div> </dd> <dt class="hdlist1"> --long </dt> <dd> <p> Give the output in the long-format. This is the default. </p> </dd> <dt class="hdlist1"> -v </dt> <dt class="hdlist1"> --verbose </dt> <dd> <p> In addition to the names of files that have been changed, also show the textual changes that are staged to be committed (i.e., like the output of <code>git diff --cached</code>). If <code>-v</code> is specified twice, then also show the changes in the working tree that have not yet been staged (i.e., like the output of <code>git diff</code>). </p> </dd> <dt class="hdlist1"> -u[<mode>] </dt> <dt class="hdlist1"> --untracked-files[=<mode>] </dt> <dd> <p> Show untracked files. </p> <div class="openblock"> <div class="content"> <div class="paragraph"><p>The mode parameter is used to specify the handling of untracked files. It is optional: it defaults to <em>all</em>, and if specified, it must be stuck to the option (e.g. <code>-uno</code>, but not <code>-u no</code>).</p></div> <div class="paragraph"><p>The possible options are:</p></div> <div class="ulist"><ul> <li> <p> <em>no</em> - Show no untracked files. </p> </li> <li> <p> <em>normal</em> - Shows untracked files and directories. </p> </li> <li> <p> <em>all</em> - Also shows individual files in untracked directories. </p> </li> </ul></div> <div class="paragraph"><p>When <code>-u</code> option is not used, untracked files and directories are shown (i.e. the same as specifying <code>normal</code>), to help you avoid forgetting to add newly created files. Because it takes extra work to find untracked files in the filesystem, this mode may take some time in a large working tree. Consider enabling untracked cache and split index if supported (see <code>git update-index --untracked-cache</code> and <code>git update-index --split-index</code>), Otherwise you can use <code>no</code> to have <code>git status</code> return more quickly without showing untracked files.</p></div> <div class="paragraph"><p>The default can be changed using the status.showUntrackedFiles configuration variable documented in <a href="git-config.html">git-config(1)</a>.</p></div> </div></div> </dd> <dt class="hdlist1"> --ignore-submodules[=<when>] </dt> <dd> <p> Ignore changes to submodules when looking for changes. <when> can be either "none", "untracked", "dirty" or "all", which is the default. Using "none" will consider the submodule modified when it either contains untracked or modified files or its HEAD differs from the commit recorded in the superproject and can be used to override any settings of the <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When "untracked" is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content). Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior before 1.7.0). Using "all" hides all changes to submodules (and suppresses the output of submodule summaries when the config option <code>status.submoduleSummary</code> is set). </p> </dd> <dt class="hdlist1"> --ignored[=<mode>] </dt> <dd> <p> Show ignored files as well. </p> <div class="openblock"> <div class="content"> <div class="paragraph"><p>The mode parameter is used to specify the handling of ignored files. It is optional: it defaults to <em>traditional</em>.</p></div> <div class="paragraph"><p>The possible options are:</p></div> <div class="ulist"><ul> <li> <p> <em>traditional</em> - Shows ignored files and directories, unless --untracked-files=all is specified, in which case individual files in ignored directories are displayed. </p> </li> <li> <p> <em>no</em> - Show no ignored files. </p> </li> <li> <p> <em>matching</em> - Shows ignored files and directories matching an ignore pattern. </p> </li> </ul></div> <div class="paragraph"><p>When <em>matching</em> mode is specified, paths that explicitly match an ignored pattern are shown. If a directory matches an ignore pattern, then it is shown, but not paths contained in the ignored directory. If a directory does not match an ignore pattern, but all contents are ignored, then the directory is not shown, but all contents are shown.</p></div> </div></div> </dd> <dt class="hdlist1"> -z </dt> <dd> <p> Terminate entries with NUL, instead of LF. This implies the <code>--porcelain=v1</code> output format if no other format is given. </p> </dd> <dt class="hdlist1"> --column[=<options>] </dt> <dt class="hdlist1"> --no-column </dt> <dd> <p> Display untracked files in columns. See configuration variable <code>column.status</code> for option syntax. <code>--column</code> and <code>--no-column</code> without options are equivalent to <em>always</em> and <em>never</em> respectively. </p> </dd> <dt class="hdlist1"> --ahead-behind </dt> <dt class="hdlist1"> --no-ahead-behind </dt> <dd> <p> Display or do not display detailed ahead/behind counts for the branch relative to its upstream branch. Defaults to true. </p> </dd> <dt class="hdlist1"> --renames </dt> <dt class="hdlist1"> --no-renames </dt> <dd> <p> Turn on/off rename detection regardless of user configuration. See also <a href="git-diff.html">git-diff(1)</a> <code>--no-renames</code>. </p> </dd> <dt class="hdlist1"> --find-renames[=<n>] </dt> <dd> <p> Turn on rename detection, optionally setting the similarity threshold. See also <a href="git-diff.html">git-diff(1)</a> <code>--find-renames</code>. </p> </dd> <dt class="hdlist1"> <pathspec>… </dt> <dd> <p> See the <em>pathspec</em> entry in <a href="gitglossary.html">gitglossary(7)</a>. </p> </dd> </dl></div> </div> </div> <div class="sect1"> <h2 id="_output">OUTPUT</h2> <div class="sectionbody"> <div class="paragraph"><p>The output from this command is designed to be used as a commit template comment. The default, long format, is designed to be human readable, verbose and descriptive. Its contents and format are subject to change at any time.</p></div> <div class="paragraph"><p>The paths mentioned in the output, unlike many other Git commands, are made relative to the current directory if you are working in a subdirectory (this is on purpose, to help cutting and pasting). See the status.relativePaths config option below.</p></div> <div class="sect2"> <h3 id="_short_format">Short Format</h3> <div class="paragraph"><p>In the short-format, the status of each path is shown as one of these forms</p></div> <div class="literalblock"> <div class="content"> <pre><code>XY PATH XY ORIG_PATH -> PATH</code></pre> </div></div> <div class="paragraph"><p>where <code>ORIG_PATH</code> is where the renamed/copied contents came from. <code>ORIG_PATH</code> is only shown when the entry is renamed or copied. The <code>XY</code> is a two-letter status code.</p></div> <div class="paragraph"><p>The fields (including the <code>-></code>) are separated from each other by a single space. If a filename contains whitespace or other nonprintable characters, that field will be quoted in the manner of a C string literal: surrounded by ASCII double quote (34) characters, and with interior special characters backslash-escaped.</p></div> <div class="paragraph"><p>There are three different types of states that are shown using this format, and each one uses the <code>XY</code> syntax differently:</p></div> <div class="ulist"><ul> <li> <p> When a merge is occurring and the merge was successful, or outside of a merge situation, <code>X</code> shows the status of the index and <code>Y</code> shows the status of the working tree. </p> </li> <li> <p> When a merge conflict has occurred and has not yet been resolved, <code>X</code> and <code>Y</code> show the state introduced by each head of the merge, relative to the common ancestor. These paths are said to be <em>unmerged</em>. </p> </li> <li> <p> When a path is untracked, <code>X</code> and <code>Y</code> are always the same, since they are unknown to the index. <code>??</code> is used for untracked paths. Ignored files are not listed unless <code>--ignored</code> is used; if it is, ignored files are indicated by <code>!!</code>. </p> </li> </ul></div> <div class="paragraph"><p>Note that the term <em>merge</em> here also includes rebases using the default <code>--merge</code> strategy, cherry-picks, and anything else using the merge machinery.</p></div> <div class="paragraph"><p>In the following table, these three classes are shown in separate sections, and these characters are used for <code>X</code> and <code>Y</code> fields for the first two sections that show tracked paths:</p></div> <div class="ulist"><ul> <li> <p> ' ' = unmodified </p> </li> <li> <p> <em>M</em> = modified </p> </li> <li> <p> <em>T</em> = file type changed (regular file, symbolic link or submodule) </p> </li> <li> <p> <em>A</em> = added </p> </li> <li> <p> <em>D</em> = deleted </p> </li> <li> <p> <em>R</em> = renamed </p> </li> <li> <p> <em>C</em> = copied (if config option status.renames is set to "copies") </p> </li> <li> <p> <em>U</em> = updated but unmerged </p> </li> </ul></div> <div class="literalblock"> <div class="content"> <pre><code>X Y Meaning ------------------------------------------------- [AMD] not updated M [ MTD] updated in index T [ MTD] type changed in index A [ MTD] added to index D deleted from index R [ MTD] renamed in index C [ MTD] copied in index [MTARC] index and work tree matches [ MTARC] M work tree changed since index [ MTARC] T type changed in work tree since index [ MTARC] D deleted in work tree R renamed in work tree C copied in work tree ------------------------------------------------- D D unmerged, both deleted A U unmerged, added by us U D unmerged, deleted by them U A unmerged, added by them D U unmerged, deleted by us A A unmerged, both added U U unmerged, both modified ------------------------------------------------- ? ? untracked ! ! ignored -------------------------------------------------</code></pre> </div></div> <div class="paragraph"><p>Submodules have more state and instead report</p></div> <div class="ulist"><ul> <li> <p> <em>M</em> = the submodule has a different HEAD than recorded in the index </p> </li> <li> <p> <em>m</em> = the submodule has modified content </p> </li> <li> <p> <em>?</em> = the submodule has untracked files </p> </li> </ul></div> <div class="paragraph"><p>This is since modified content or untracked files in a submodule cannot be added via <code>git add</code> in the superproject to prepare a commit.</p></div> <div class="paragraph"><p><em>m</em> and <em>?</em> are applied recursively. For example if a nested submodule in a submodule contains an untracked file, this is reported as <em>?</em> as well.</p></div> <div class="paragraph"><p>If -b is used the short-format status is preceded by a line</p></div> <div class="literalblock"> <div class="content"> <pre><code>## branchname tracking info</code></pre> </div></div> </div> <div class="sect2"> <h3 id="_porcelain_format_version_1">Porcelain Format Version 1</h3> <div class="paragraph"><p>Version 1 porcelain format is similar to the short format, but is guaranteed not to change in a backwards-incompatible way between Git versions or based on user configuration. This makes it ideal for parsing by scripts. The description of the short format above also describes the porcelain format, with a few exceptions:</p></div> <div class="olist arabic"><ol class="arabic"> <li> <p> The user’s color.status configuration is not respected; color will always be off. </p> </li> <li> <p> The user’s status.relativePaths configuration is not respected; paths shown will always be relative to the repository root. </p> </li> </ol></div> <div class="paragraph"><p>There is also an alternate -z format recommended for machine parsing. In that format, the status field is the same, but some other things change. First, the <em>-></em> is omitted from rename entries and the field order is reversed (e.g <em>from -> to</em> becomes <em>to from</em>). Second, a NUL (ASCII 0) follows each filename, replacing space as a field separator and the terminating newline (but a space still separates the status field from the first filename). Third, filenames containing special characters are not specially formatted; no quoting or backslash-escaping is performed.</p></div> <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> </div> <div class="sect2"> <h3 id="_porcelain_format_version_2">Porcelain Format Version 2</h3> <div class="paragraph"><p>Version 2 format adds more detailed information about the state of the worktree and changed items. Version 2 also defines an extensible set of easy to parse optional headers.</p></div> <div class="paragraph"><p>Header lines start with "#" and are added in response to specific command line arguments. Parsers should ignore headers they don’t recognize.</p></div> <div class="sect3"> <h4 id="_branch_headers">Branch Headers</h4> <div class="paragraph"><p>If <code>--branch</code> is given, a series of header lines are printed with information about the current branch.</p></div> <div class="literalblock"> <div class="content"> <pre><code>Line Notes ------------------------------------------------------------ # branch.oid <commit> | (initial) Current commit. # branch.head <branch> | (detached) Current branch. # branch.upstream <upstream_branch> If upstream is set. # branch.ab +<ahead> -<behind> If upstream is set and the commit is present. ------------------------------------------------------------</code></pre> </div></div> </div> <div class="sect3"> <h4 id="_stash_information">Stash Information</h4> <div class="paragraph"><p>If <code>--show-stash</code> is given, one line is printed showing the number of stash entries if non-zero:</p></div> <div class="literalblock"> <div class="content"> <pre><code># stash <N></code></pre> </div></div> </div> <div class="sect3"> <h4 id="_changed_tracked_entries">Changed Tracked Entries</h4> <div class="paragraph"><p>Following the headers, a series of lines are printed for tracked entries. One of three different line formats may be used to describe an entry depending on the type of change. Tracked entries are printed in an undefined order; parsers should allow for a mixture of the 3 line types in any order.</p></div> <div class="paragraph"><p>Ordinary changed entries have the following format:</p></div> <div class="literalblock"> <div class="content"> <pre><code>1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path></code></pre> </div></div> <div class="paragraph"><p>Renamed or copied entries have the following format:</p></div> <div class="literalblock"> <div class="content"> <pre><code>2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath></code></pre> </div></div> <div class="literalblock"> <div class="content"> <pre><code>Field Meaning -------------------------------------------------------- <XY> A 2 character field containing the staged and unstaged XY values described in the short format, with unchanged indicated by a "." rather than a space. <sub> A 4 character field describing the submodule state. "N..." when the entry is not a submodule. "S<c><m><u>" when the entry is a submodule. <c> is "C" if the commit changed; otherwise ".". <m> is "M" if it has tracked changes; otherwise ".". <u> is "U" if there are untracked changes; otherwise ".". <mH> The octal file mode in HEAD. <mI> The octal file mode in the index. <mW> The octal file mode in the worktree. <hH> The object name in HEAD. <hI> The object name in the index. <X><score> The rename or copy score (denoting the percentage of similarity between the source and target of the move or copy). For example "R100" or "C75". <path> The pathname. In a renamed/copied entry, this is the target path. <sep> When the `-z` option is used, the 2 pathnames are separated with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09) byte separates them. <origPath> The pathname in the commit at HEAD or in the index. This is only present in a renamed/copied entry, and tells where the renamed/copied contents came from. --------------------------------------------------------</code></pre> </div></div> <div class="paragraph"><p>Unmerged entries have the following format; the first character is a "u" to distinguish from ordinary changed entries.</p></div> <div class="literalblock"> <div class="content"> <pre><code>u <XY> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path></code></pre> </div></div> <div class="literalblock"> <div class="content"> <pre><code>Field Meaning -------------------------------------------------------- <XY> A 2 character field describing the conflict type as described in the short format. <sub> A 4 character field describing the submodule state as described above. <m1> The octal file mode in stage 1. <m2> The octal file mode in stage 2. <m3> The octal file mode in stage 3. <mW> The octal file mode in the worktree. <h1> The object name in stage 1. <h2> The object name in stage 2. <h3> The object name in stage 3. <path> The pathname. --------------------------------------------------------</code></pre> </div></div> </div> <div class="sect3"> <h4 id="_other_items">Other Items</h4> <div class="paragraph"><p>Following the tracked entries (and if requested), a series of lines will be printed for untracked and then ignored items found in the worktree.</p></div> <div class="paragraph"><p>Untracked items have the following format:</p></div> <div class="literalblock"> <div class="content"> <pre><code>? <path></code></pre> </div></div> <div class="paragraph"><p>Ignored items have the following format:</p></div> <div class="literalblock"> <div class="content"> <pre><code>! <path></code></pre> </div></div> </div> <div class="sect3"> <h4 id="_pathname_format_notes_and_z">Pathname Format Notes and -z</h4> <div class="paragraph"><p>When the <code>-z</code> option is given, pathnames are printed as is and without any quoting and lines are terminated with a NUL (ASCII 0x00) byte.</p></div> <div class="paragraph"><p>Without the <code>-z</code> option, pathnames with "unusual" characters are quoted as explained for the configuration variable <code>core.quotePath</code> (see <a href="git-config.html">git-config(1)</a>).</p></div> </div> </div> </div> </div> <div class="sect1"> <h2 id="_configuration">CONFIGURATION</h2> <div class="sectionbody"> <div class="paragraph"><p>The command honors <code>color.status</code> (or <code>status.color</code> — they mean the same thing and the latter is kept for backward compatibility) and <code>color.status.<slot></code> configuration variables to colorize its output.</p></div> <div class="paragraph"><p>If the config variable <code>status.relativePaths</code> is set to false, then all paths shown are relative to the repository root, not to the current directory.</p></div> <div class="paragraph"><p>If <code>status.submoduleSummary</code> is set to a non zero number or true (identical to -1 or an unlimited number), the submodule summary will be enabled for the long format and a summary of commits for modified submodules will be shown (see --summary-limit option of <a href="git-submodule.html">git-submodule(1)</a>). Please note that the summary output from the status command will be suppressed for all submodules when <code>diff.ignoreSubmodules</code> is set to <em>all</em> or only for those submodules where <code>submodule.<name>.ignore=all</code>. To also view the summary for ignored submodules you can either use the --ignore-submodules=dirty command line option or the <em>git submodule summary</em> command, which shows a similar output but does not honor these settings.</p></div> </div> </div> <div class="sect1"> <h2 id="_background_refresh">BACKGROUND REFRESH</h2> <div class="sectionbody"> <div class="paragraph"><p>By default, <code>git status</code> will automatically refresh the index, updating the cached stat information from the working tree and writing out the result. Writing out the updated index is an optimization that isn’t strictly necessary (<code>status</code> computes the values for itself, but writing them out is just to save subsequent programs from repeating our computation). When <code>status</code> is run in the background, the lock held during the write may conflict with other simultaneous processes, causing them to fail. Scripts running <code>status</code> in the background should consider using <code>git --no-optional-locks status</code> (see <a href="git.html">git(1)</a> for details).</p></div> </div> </div> <div class="sect1"> <h2 id="_untracked_files_and_performance">UNTRACKED FILES AND PERFORMANCE</h2> <div class="sectionbody"> <div class="paragraph"><p><code>git status</code> can be very slow in large worktrees if/when it needs to search for untracked files and directories. There are many configuration options available to speed this up by either avoiding the work or making use of cached results from previous Git commands. There is no single optimum set of settings right for everyone. We’ll list a summary of the relevant options to help you, but before going into the list, you may want to run <code>git status</code> again, because your configuration may already be caching <code>git status</code> results, so it could be faster on subsequent runs.</p></div> <div class="ulist"><ul> <li> <p> The <code>--untracked-files=no</code> flag or the <code>status.showUntrackedfiles=false</code> config (see above for both): indicate that <code>git status</code> should not report untracked files. This is the fastest option. <code>git status</code> will not list the untracked files, so you need to be careful to remember if you create any new files and manually <code>git add</code> them. </p> </li> <li> <p> <code>advice.statusUoption=false</code> (see <a href="git-config.html">git-config(1)</a>): setting this variable to <code>false</code> disables the warning message given when enumerating untracked files takes more than 2 seconds. In a large project, it may take longer and the user may have already accepted the trade off (e.g. using "-uno" may not be an acceptable option for the user), in which case, there is no point issuing the warning message, and in such a case, disabling the warning may be the best. </p> </li> <li> <p> <code>core.untrackedCache=true</code> (see <a href="git-update-index.html">git-update-index(1)</a>): enable the untracked cache feature and only search directories that have been modified since the previous <code>git status</code> command. Git remembers the set of untracked files within each directory and assumes that if a directory has not been modified, then the set of untracked files within has not changed. This is much faster than enumerating the contents of every directory, but still not without cost, because Git still has to search for the set of modified directories. The untracked cache is stored in the <code>.git/index</code> file. The reduced cost of searching for untracked files is offset slightly by the increased size of the index and the cost of keeping it up-to-date. That reduced search time is usually worth the additional size. </p> </li> <li> <p> <code>core.untrackedCache=true</code> and <code>core.fsmonitor=true</code> or <code>core.fsmonitor=<hook_command_pathname></code> (see <a href="git-update-index.html">git-update-index(1)</a>): enable both the untracked cache and FSMonitor features and only search directories that have been modified since the previous <code>git status</code> command. This is faster than using just the untracked cache alone because Git can also avoid searching for modified directories. Git only has to enumerate the exact set of directories that have changed recently. While the FSMonitor feature can be enabled without the untracked cache, the benefits are greatly reduced in that case. </p> </li> </ul></div> <div class="paragraph"><p>Note that after you turn on the untracked cache and/or FSMonitor features it may take a few <code>git status</code> commands for the various caches to warm up before you see improved command times. This is normal.</p></div> </div> </div> <div class="sect1"> <h2 id="_see_also">SEE ALSO</h2> <div class="sectionbody"> <div class="paragraph"><p><a href="gitignore.html">gitignore(5)</a></p></div> </div> </div> <div class="sect1"> <h2 id="_git">GIT</h2> <div class="sectionbody"> <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> </div> </div> </div> <div id="footnotes"><hr /></div> <div id="footer"> <div id="footer-text"> Last updated 2024-05-31 00:41:06 UTC </div> </div> </body> </html>