Lesson 7 / 26

The Three States

Working directory, staging area, and repository — where a change travels.

Working dir → staging → repo

A change lives in the working directory (files on disk), gets marked ready in the staging area (git add), then is permanently recorded in the repository (git commit).

Like packing a box

The working directory is your room, the staging area is the box you're packing, and a commit is sealing and shipping that box for good.

Why stage at all?

Staging lets you build a commit from only some of your changes — you don't have to commit everything you touched at once.