The three areas
Think of git as having three rooms:
- **Working directory*: your files exactly as they are now, messy and open.
- **Staging area*: the exact set of changes you are about to save, like a packing box.
- **Repository*: everything already committed, locked into history.
git add . # move things into the box
git commit # seal the box into history
Staging is optional but it keeps history clean. You don't have to commit a snapshot of your whole folder every time.
Why stage at all
Because not every change is ready to be saved, and not every change belongs in the same commit. Maybe you fixed a bug but also left an experiment half-typed. Stage the fix, leave the experiment. git status tells you what is waiting in the box so you can decide before you commit.