@@ -72,21 +72,37 @@ In short-format, the status of each path is shown as
72
72
73
73
where `PATH1` is the path in the `HEAD`, and ` -> PATH2` part is
74
74
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.
83
99
84
100
X Y Meaning
85
101
-------------------------------------------------
86
102
[MD] not updated
87
103
M [ MD] updated in index
88
104
A [ MD] added to index
89
- D [ MD ] deleted from index
105
+ D [ M ] deleted from index
90
106
R [ MD] renamed in index
91
107
C [ MD] copied in index
92
108
[MARC] index and work tree matches
@@ -104,6 +120,15 @@ and `Y` shows the status of the work tree. For untracked paths, `XY` are
104
120
? ? untracked
105
121
-------------------------------------------------
106
122
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.
107
132
108
133
CONFIGURATION
109
134
-------------
0 commit comments