Skip to content

Commit 34c071a

Browse files
committed
Merge branch 'maint'
* maint: Documentation improvements for the description of short format.
2 parents 08641d0 + e92e9cd commit 34c071a

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed

Documentation/git-status.txt

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,37 @@ In short-format, the status of each path is shown as
7272

7373
where `PATH1` is the path in the `HEAD`, and ` -> PATH2` part is
7474
shown only when `PATH1` corresponds to a different path in the
75-
index/worktree (i.e. renamed).
76-
77-
For unmerged entries, `X` shows the status of stage #2 (i.e. ours) and `Y`
78-
shows the status of stage #3 (i.e. theirs).
79-
80-
For entries that do not have conflicts, `X` shows the status of the index,
81-
and `Y` shows the status of the work tree. For untracked paths, `XY` are
82-
`??`.
75+
index/worktree (i.e. the file is renamed). The 'XY' is a two-letter
76+
status code.
77+
78+
The fields (including the `->`) are separated from each other by a
79+
single space. If a filename contains whitespace or other nonprintable
80+
characters, that field will be quoted in the manner of a C string
81+
literal: surrounded by ASCII double quote (34) characters, and with
82+
interior special characters backslash-escaped.
83+
84+
For paths with merge conflicts, `X` and 'Y' show the modification
85+
states of each side of the merge. For paths that do not have merge
86+
conflicts, `X` shows the status of the index, and `Y` shows the status
87+
of the work tree. For untracked paths, `XY` are `??`. Other status
88+
codes can be interpreted as follows:
89+
90+
* ' ' = unmodified
91+
* 'M' = modified
92+
* 'A' = added
93+
* 'D' = deleted
94+
* 'R' = renamed
95+
* 'C' = copied
96+
* 'U' = updated but unmerged
97+
98+
Ignored files are not listed.
8399

84100
X Y Meaning
85101
-------------------------------------------------
86102
[MD] not updated
87103
M [ MD] updated in index
88104
A [ MD] added to index
89-
D [ MD] deleted from index
105+
D [ M] deleted from index
90106
R [ MD] renamed in index
91107
C [ MD] copied in index
92108
[MARC] index and work tree matches
@@ -104,6 +120,15 @@ and `Y` shows the status of the work tree. For untracked paths, `XY` are
104120
? ? untracked
105121
-------------------------------------------------
106122

123+
There is an alternate -z format recommended for machine parsing. In
124+
that format, the status field is the same, but some other things
125+
change. First, the '->' is omitted from rename entries and the field
126+
order is reversed (e.g 'from -> to' becomes 'to from'). Second, a NUL
127+
(ASCII 0) follows each filename, replacing space as a field separator
128+
and the terminating newline (but a space still separates the status
129+
field from the first filename). Third, filenames containing special
130+
characters are not specially formatted; no quoting or
131+
backslash-escaping is performed.
107132

108133
CONFIGURATION
109134
-------------

0 commit comments

Comments
 (0)