1GIT-STATUS(1) Git Manual GIT-STATUS(1)
2
3
4
6 git-status - Show the working tree status
7
9 git status [<options>...] [--] [<pathspec>...]
10
11
13 Displays paths that have differences between the index file and the
14 current HEAD commit, paths that have differences between the working
15 tree and the index file, and paths in the working tree that are not
16 tracked by Git (and are not ignored by gitignore(5)). The first are
17 what you would commit by running git commit; the second and third are
18 what you could commit by running git add before running git commit.
19
21 -s, --short
22 Give the output in the short-format.
23
24 -b, --branch
25 Show the branch and tracking info even in short-format.
26
27 --porcelain
28 Give the output in an easy-to-parse format for scripts. This is
29 similar to the short output, but will remain stable across Git
30 versions and regardless of user configuration. See below for
31 details.
32
33 --long
34 Give the output in the long-format. This is the default.
35
36 -u[<mode>], --untracked-files[=<mode>]
37 Show untracked files.
38
39 The mode parameter is optional (defaults to all), and is used to
40 specify the handling of untracked files.
41
42 The possible options are:
43
44 · no - Show no untracked files.
45
46 · normal - Shows untracked files and directories.
47
48 · all - Also shows individual files in untracked directories.
49
50 When -u option is not used, untracked files and directories are
51 shown (i.e. the same as specifying normal), to help you avoid
52 forgetting to add newly created files. Because it takes extra
53 work to find untracked files in the filesystem, this mode may
54 take some time in a large working tree. You can use no to have
55 git status return more quickly without showing untracked files.
56
57 The default can be changed using the status.showUntrackedFiles
58 configuration variable documented in git-config(1).
59
60 --ignore-submodules[=<when>]
61 Ignore changes to submodules when looking for changes. <when> can
62 be either "none", "untracked", "dirty" or "all", which is the
63 default. Using "none" will consider the submodule modified when it
64 either contains untracked or modified files or its HEAD differs
65 from the commit recorded in the superproject and can be used to
66 override any settings of the ignore option in git-config(1) or
67 gitmodules(5). When "untracked" is used submodules are not
68 considered dirty when they only contain untracked content (but they
69 are still scanned for modified content). Using "dirty" ignores all
70 changes to the work tree of submodules, only changes to the commits
71 stored in the superproject are shown (this was the behavior before
72 1.7.0). Using "all" hides all changes to submodules (and suppresses
73 the output of submodule summaries when the config option
74 status.submodulesummary is set).
75
76 --ignored
77 Show ignored files as well.
78
79 -z
80 Terminate entries with NUL, instead of LF. This implies the
81 --porcelain output format if no other format is given.
82
83 --column[=<options>], --no-column
84 Display untracked files in columns. See configuration variable
85 column.status for option syntax.--column and --no-column without
86 options are equivalent to always and never respectively.
87
89 The output from this command is designed to be used as a commit
90 template comment, and all the output lines are prefixed with #. The
91 default, long format, is designed to be human readable, verbose and
92 descriptive. Its contents and format are subject to change at any time.
93
94 The paths mentioned in the output, unlike many other Git commands, are
95 made relative to the current directory if you are working in a
96 subdirectory (this is on purpose, to help cutting and pasting). See the
97 status.relativePaths config option below.
98
99 Short Format
100 In the short-format, the status of each path is shown as
101
102 XY PATH1 -> PATH2
103
104 where PATH1 is the path in the HEAD, and the " -> PATH2" part is shown
105 only when PATH1 corresponds to a different path in the index/worktree
106 (i.e. the file is renamed). The XY is a two-letter status code.
107
108 The fields (including the ->) are separated from each other by a single
109 space. If a filename contains whitespace or other nonprintable
110 characters, that field will be quoted in the manner of a C string
111 literal: surrounded by ASCII double quote (34) characters, and with
112 interior special characters backslash-escaped.
113
114 For paths with merge conflicts, X and Y show the modification states of
115 each side of the merge. For paths that do not have merge conflicts, X
116 shows the status of the index, and Y shows the status of the work tree.
117 For untracked paths, XY are ??. Other status codes can be interpreted
118 as follows:
119
120 · ' ' = unmodified
121
122 · M = modified
123
124 · A = added
125
126 · D = deleted
127
128 · R = renamed
129
130 · C = copied
131
132 · U = updated but unmerged
133
134 Ignored files are not listed, unless --ignored option is in effect, in
135 which case XY are !!.
136
137 X Y Meaning
138 -------------------------------------------------
139 [MD] not updated
140 M [ MD] updated in index
141 A [ MD] added to index
142 D [ M] deleted from index
143 R [ MD] renamed in index
144 C [ MD] copied in index
145 [MARC] index and work tree matches
146 [ MARC] M work tree changed since index
147 [ MARC] D deleted in work tree
148 -------------------------------------------------
149 D D unmerged, both deleted
150 A U unmerged, added by us
151 U D unmerged, deleted by them
152 U A unmerged, added by them
153 D U unmerged, deleted by us
154 A A unmerged, both added
155 U U unmerged, both modified
156 -------------------------------------------------
157 ? ? untracked
158 ! ! ignored
159 -------------------------------------------------
160
161 If -b is used the short-format status is preceded by a line
162
163 ## branchname tracking info
164
165 Porcelain Format
166 The porcelain format is similar to the short format, but is guaranteed
167 not to change in a backwards-incompatible way between Git versions or
168 based on user configuration. This makes it ideal for parsing by
169 scripts. The description of the short format above also describes the
170 porcelain format, with a few exceptions:
171
172 1. The user’s color.status configuration is not respected; color will
173 always be off.
174
175 2. The user’s status.relativePaths configuration is not respected;
176 paths shown will always be relative to the repository root.
177
178 There is also an alternate -z format recommended for machine parsing.
179 In that format, the status field is the same, but some other things
180 change. First, the -> is omitted from rename entries and the field
181 order is reversed (e.g from -> to becomes to from). Second, a NUL
182 (ASCII 0) follows each filename, replacing space as a field separator
183 and the terminating newline (but a space still separates the status
184 field from the first filename). Third, filenames containing special
185 characters are not specially formatted; no quoting or
186 backslash-escaping is performed.
187
189 The command honors color.status (or status.color — they mean the same
190 thing and the latter is kept for backward compatibility) and
191 color.status.<slot> configuration variables to colorize its output.
192
193 If the config variable status.relativePaths is set to false, then all
194 paths shown are relative to the repository root, not to the current
195 directory.
196
197 If status.submodulesummary is set to a non zero number or true
198 (identical to -1 or an unlimited number), the submodule summary will be
199 enabled for the long format and a summary of commits for modified
200 submodules will be shown (see --summary-limit option of git-
201 submodule(1)).
202
204 gitignore(5)
205
207 Part of the git(1) suite
208
209
210
211Git 1.8.3.1 11/19/2018 GIT-STATUS(1)