Understanding Short Git Status

Short status separates changes selected in the index from working-tree changes. The two positions can tell different stories about one path.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a modified file twice
  2. Confirm before summarizing a commit
  3. Read the two positions in a tracked status entry
  4. Confirm the diff each position describes

Trace a modified file twice

After staging a modification and then editing the file again, a tracked path can show a change on both sides. A new untracked file has its own marker. See Git's working tree, index, and commit.

Confirm before summarizing a commit

Status lists affected paths and kinds of changes. A staged diff still reveals whether the selected content includes the intended fix and test.[1]

Read the two positions in a tracked status entry

An entry MM report.txt outside conflict status means an index modification relative to HEAD and a working modification relative to the index. An entry M report.txt shows a working modification only. An untracked path uses two question marks. See the working tree, index and commit.

"M " → staged modification alone
" M" → unstaged modification alone
"MM" → both states modified
"??" → untracked

Confirm the diff each position describes

Short codes indicate state without showing content. Check staged and unstaged diffs separately. Conflict and rename cases can have additional meanings. Test your interpretation on a file edited once before and once after staging.

References

  1. Scott Chacon and Ben Straub, Pro Git ↩