Staging area
A middle ground where you prepare and gather specific modified files before wrapping them up into a permanent commit.
What it is
The staging area (or index) is a file that keeps track of what will go into your next commit. You must explicitly "add" modified files from your working directory into the staging area. This allows you to selectively group related changes together into a single commit, even if you've modified dozens of files.
When you would use it
You use the staging area after writing code, but right before committing, to carefully curate exactly which file changes belong in the next snapshot.
Common operations
- Selectively adding a few changed files to form a logical feature commit.
- Reviewing exactly what changes are about to be saved.