3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.46.1.506.ged155187b4
10 .TH "GIT\-STATUS" "1" "2024-09-13" "Git 2\&.46\&.1\&.506\&.ged1551" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-status \- Show the working tree status
35 \fIgit status\fR [<options>] [\-\-] [<pathspec>\&...\:]
39 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 \fBgitignore\fR(5))\&. The first are what you \fIwould\fR commit by running \fBgit commit\fR; the second and third are what you \fIcould\fR commit by running \fIgit add\fR before running \fBgit commit\fR\&.
44 Give the output in the short\-format\&.
49 Show the branch and tracking info even in short\-format\&.
54 Show the number of entries currently stashed away\&.
57 \-\-porcelain[=<version>]
59 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\&.
61 The version parameter is used to specify the format version\&. This is optional and defaults to the original version
68 Give the output in the long\-format\&. This is the default\&.
73 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
74 \fBgit diff \-\-cached\fR)\&. If
76 is specified twice, then also show the changes in the working tree that have not yet been staged (i\&.e\&., like the output of
80 \-u[<mode>], \-\-untracked\-files[=<mode>]
82 Show untracked files\&.
84 The mode parameter is used to specify the handling of untracked files\&. It is optional: it defaults to
85 \fIall\fR, and if specified, it must be stuck to the option (e\&.g\&.
89 The possible options are:
100 \- Show no untracked files\&.
112 \- Shows untracked files and directories\&.
124 \- Also shows individual files in untracked directories\&.
129 option is not used, untracked files and directories are shown (i\&.e\&. the same as specifying
130 \fBnormal\fR), 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
131 \fBgit update\-index \-\-untracked\-cache\fR
133 \fBgit update\-index \-\-split\-index\fR), Otherwise you can use
137 return more quickly without showing untracked files\&. All usual spellings for Boolean value
146 The default can be changed using the status\&.showUntrackedFiles configuration variable documented in
147 \fBgit-config\fR(1)\&.
150 \-\-ignore\-submodules[=<when>]
152 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
157 \fBgitmodules\fR(5)\&. 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
158 \fBstatus\&.submoduleSummary\fR
164 Show ignored files as well\&.
166 The mode parameter is used to specify the handling of ignored files\&. It is optional: it defaults to
169 The possible options are:
180 \- Shows ignored files and directories, unless \-\-untracked\-files=all is specified, in which case individual files in ignored directories are displayed\&.
192 \- Show no ignored files\&.
204 \- Shows ignored files and directories matching an ignore pattern\&.
209 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\&.
214 Terminate entries with NUL, instead of LF\&. This implies the
215 \fB\-\-porcelain=v1\fR
216 output format if no other format is given\&.
219 \-\-column[=<options>], \-\-no\-column
221 Display untracked files in columns\&. See configuration variable
222 \fBcolumn\&.status\fR
227 without options are equivalent to
234 \-\-ahead\-behind, \-\-no\-ahead\-behind
236 Display or do not display detailed ahead/behind counts for the branch relative to its upstream branch\&. Defaults to true\&.
239 \-\-renames, \-\-no\-renames
241 Turn on/off rename detection regardless of user configuration\&. See also
243 \fB\-\-no\-renames\fR\&.
246 \-\-find\-renames[=<n>]
248 Turn on rename detection, optionally setting the similarity threshold\&. See also
250 \fB\-\-find\-renames\fR\&.
258 \fBgitglossary\fR(7)\&.
262 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\&.
264 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\&.
267 In the short\-format, the status of each path is shown as one of these forms
274 XY ORIG_PATH \-> PATH
280 where \fBORIG_PATH\fR is where the renamed/copied contents came from\&. \fBORIG_PATH\fR is only shown when the entry is renamed or copied\&. The \fBXY\fR is a two\-letter status code\&.
282 The fields (including the \fB\->\fR) 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\&.
284 There are three different types of states that are shown using this format, and each one uses the \fBXY\fR syntax differently:
294 When a merge is occurring and the merge was successful, or outside of a merge situation,
296 shows the status of the index and
298 shows the status of the working tree\&.
309 When a merge conflict has occurred and has not yet been resolved,
313 show the state introduced by each head of the merge, relative to the common ancestor\&. These paths are said to be
325 When a path is untracked,
329 are always the same, since they are unknown to the index\&.
331 is used for untracked paths\&. Ignored files are not listed unless
333 is used; if it is, ignored files are indicated by
337 Note that the term \fImerge\fR here also includes rebases using the default \fB\-\-merge\fR strategy, cherry\-picks, and anything else using the merge machinery\&.
339 In the following table, these three classes are shown in separate sections, and these characters are used for \fBX\fR and \fBY\fR fields for the first two sections that show tracked paths:
349 \*(Aq \*(Aq = unmodified
373 = file type changed (regular file, symbolic link or submodule)
421 = copied (if config option status\&.renames is set to "copies")
433 = updated but unmerged
441 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
443 M [ MTD] updated in index
444 T [ MTD] type changed in index
445 A [ MTD] added to index
447 R [ MTD] renamed in index
448 C [ MTD] copied in index
449 [MTARC] index and work tree matches
450 [ MTARC] M work tree changed since index
451 [ MTARC] T type changed in work tree since index
452 [ MTARC] D deleted in work tree
453 R renamed in work tree
454 C copied in work tree
455 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
456 D D unmerged, both deleted
457 A U unmerged, added by us
458 U D unmerged, deleted by them
459 U A unmerged, added by them
460 D U unmerged, deleted by us
461 A A unmerged, both added
462 U U unmerged, both modified
463 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
466 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
472 Submodules have more state and instead report
483 = the submodule has a different HEAD than recorded in the index
495 = the submodule has modified content
507 = the submodule has untracked files
510 This is since modified content or untracked files in a submodule cannot be added via \fBgit add\fR in the superproject to prepare a commit\&.
512 \fIm\fR and \fI?\fR are applied recursively\&. For example if a nested submodule in a submodule contains an untracked file, this is reported as \fI?\fR as well\&.
514 If \-b is used the short\-format status is preceded by a line
520 ## branchname tracking info
525 .SS "Porcelain Format Version 1"
527 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:
537 The user\(cqs color\&.status configuration is not respected; color will always be off\&.
548 The user\(cqs status\&.relativePaths configuration is not respected; paths shown will always be relative to the repository root\&.
551 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 \fI\->\fR is omitted from rename entries and the field order is reversed (e\&.g \fIfrom \-> to\fR becomes \fIto from\fR)\&. 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\&.
553 Any submodule changes are reported as modified \fBM\fR instead of \fBm\fR or single \fB?\fR\&.
554 .SS "Porcelain Format Version 2"
556 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\&.
558 Header lines start with "#" and are added in response to specific command line arguments\&. Parsers should ignore headers they don\(cqt recognize\&.
561 .nr an-no-space-flag 1
568 If \fB\-\-branch\fR is given, a series of header lines are printed with information about the current branch\&.
575 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
576 # branch\&.oid <commit> | (initial) Current commit\&.
577 # branch\&.head <branch> | (detached) Current branch\&.
578 # branch\&.upstream <upstream\-branch> If upstream is set\&.
579 # branch\&.ab +<ahead> \-<behind> If upstream is set and
580 the commit is present\&.
581 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
589 .nr an-no-space-flag 1
593 \fBStash Information\fR
596 If \fB\-\-show\-stash\fR is given, one line is printed showing the number of stash entries if non\-zero:
610 .nr an-no-space-flag 1
614 \fBChanged Tracked Entries\fR
617 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\&.
619 Ordinary changed entries have the following format:
625 1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>
631 Renamed or copied entries have the following format:
637 2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
648 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
649 <XY> A 2 character field containing the staged and
650 unstaged XY values described in the short format,
651 with unchanged indicated by a "\&." rather than
653 <sub> A 4 character field describing the submodule state\&.
654 "N\&.\&.\&." when the entry is not a submodule\&.
655 "S<c><m><u>" when the entry is a submodule\&.
656 <c> is "C" if the commit changed; otherwise "\&."\&.
657 <m> is "M" if it has tracked changes; otherwise "\&."\&.
658 <u> is "U" if there are untracked changes; otherwise "\&."\&.
659 <mH> The octal file mode in HEAD\&.
660 <mI> The octal file mode in the index\&.
661 <mW> The octal file mode in the worktree\&.
662 <hH> The object name in HEAD\&.
663 <hI> The object name in the index\&.
664 <X><score> The rename or copy score (denoting the percentage
665 of similarity between the source and target of the
666 move or copy)\&. For example "R100" or "C75"\&.
667 <path> The pathname\&. In a renamed/copied entry, this
668 is the target path\&.
669 <sep> When the `\-z` option is used, the 2 pathnames are separated
670 with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)
671 byte separates them\&.
672 <origPath> The pathname in the commit at HEAD or in the index\&.
673 This is only present in a renamed/copied entry, and
674 tells where the renamed/copied contents came from\&.
675 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
681 Unmerged entries have the following format; the first character is a "u" to distinguish from ordinary changed entries\&.
687 u <XY> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>
698 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
699 <XY> A 2 character field describing the conflict type
700 as described in the short format\&.
701 <sub> A 4 character field describing the submodule state
702 as described above\&.
703 <m1> The octal file mode in stage 1\&.
704 <m2> The octal file mode in stage 2\&.
705 <m3> The octal file mode in stage 3\&.
706 <mW> The octal file mode in the worktree\&.
707 <h1> The object name in stage 1\&.
708 <h2> The object name in stage 2\&.
709 <h3> The object name in stage 3\&.
710 <path> The pathname\&.
711 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
719 .nr an-no-space-flag 1
726 Following the tracked entries (and if requested), a series of lines will be printed for untracked and then ignored items found in the worktree\&.
728 Untracked items have the following format:
740 Ignored items have the following format:
754 .nr an-no-space-flag 1
758 \fBPathname Format Notes and -z\fR
761 When the \fB\-z\fR option is given, pathnames are printed as is and without any quoting and lines are terminated with a NUL (ASCII 0x00) byte\&.
763 Without the \fB\-z\fR option, pathnames with "unusual" characters are quoted as explained for the configuration variable \fBcore\&.quotePath\fR (see \fBgit-config\fR(1))\&.
767 The command honors \fBcolor\&.status\fR (or \fBstatus\&.color\fR \(em they mean the same thing and the latter is kept for backward compatibility) and \fBcolor\&.status\&.<slot>\fR configuration variables to colorize its output\&.
769 If the config variable \fBstatus\&.relativePaths\fR is set to false, then all paths shown are relative to the repository root, not to the current directory\&.
771 If \fBstatus\&.submoduleSummary\fR 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 \fBgit-submodule\fR(1))\&. Please note that the summary output from the status command will be suppressed for all submodules when \fBdiff\&.ignoreSubmodules\fR is set to \fIall\fR or only for those submodules where \fBsubmodule\&.<name>\&.ignore=all\fR\&. To also view the summary for ignored submodules you can either use the \-\-ignore\-submodules=dirty command line option or the \fIgit submodule summary\fR command, which shows a similar output but does not honor these settings\&.
772 .SH "BACKGROUND REFRESH"
774 By default, \fBgit status\fR 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\(cqt strictly necessary (\fBstatus\fR computes the values for itself, but writing them out is just to save subsequent programs from repeating our computation)\&. When \fBstatus\fR is run in the background, the lock held during the write may conflict with other simultaneous processes, causing them to fail\&. Scripts running \fBstatus\fR in the background should consider using \fBgit \-\-no\-optional\-locks status\fR (see \fBgit\fR(1) for details)\&.
775 .SH "UNTRACKED FILES AND PERFORMANCE"
777 \fBgit status\fR 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\(cqll list a summary of the relevant options to help you, but before going into the list, you may want to run \fBgit status\fR again, because your configuration may already be caching \fBgit status\fR results, so it could be faster on subsequent runs\&.
788 \fB\-\-untracked\-files=no\fR
790 \fBstatus\&.showUntrackedFiles=no\fR
791 config (see above for both): indicate that
793 should not report untracked files\&. This is the fastest option\&.
795 will not list the untracked files, so you need to be careful to remember if you create any new files and manually
808 \fBadvice\&.statusUoption=false\fR
810 \fBgit-config\fR(1)): setting this variable to
812 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\&.
823 \fBcore\&.untrackedCache=true\fR
825 \fBgit-update-index\fR(1)): enable the untracked cache feature and only search directories that have been modified since the previous
827 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
829 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\&.
840 \fBcore\&.untrackedCache=true\fR
842 \fBcore\&.fsmonitor=true\fR
844 \fBcore\&.fsmonitor=<hook\-command\-pathname>\fR
846 \fBgit-update-index\fR(1)): enable both the untracked cache and FSMonitor features and only search directories that have been modified since the previous
848 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\&.
851 Note that after you turn on the untracked cache and/or FSMonitor features it may take a few \fBgit status\fR commands for the various caches to warm up before you see improved command times\&. This is normal\&.
857 Part of the \fBgit\fR(1) suite