Lesson 7 / 28

The Three States

Follow a change through the working directory, staging area and repository to build precise commits.

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.