Git work happens across three areas: the working directory where you edit files, the
staging index where you choose what goes into the next commit, and the repository where
committed history lives. Typical flow is edit, stage selected changes, commit a snapshot,
and repeat in small increments. Most confusion is solved by identifying which area
changed.
Before looking at the command-by-command walkthrough, this is the simplest mental
model: files start in your working tree, selected changes move into staging, and
commits save that staged snapshot into repository history.
Flow Across The Three Areas
Mental Model
The same three areas stay in place the whole time. What changes is which area Git is
reading from or writing to: git status compares them, git add
copies selected changes into the index, and git commit writes the staged
snapshot into repository history.