Skip to content

Staging Area

In one line

The staging area (index) is a middle ground where you place changes before committing them — it lets you choose exactly what to include in each commit.

In simple words

The staging area is a buffer between your working directory and the repository history. When you run git add, changes move from your working directory into the staging area. When you run git commit, staged changes are saved to history.

The staging area lets you be selective: you can modify five files but only stage and commit two of them. This lets you create focused, atomic commits even when you have multiple unrelated changes in your working directory.

The staging area is also called the "index" — they are the same thing. git status shows you three sections: unstaged changes (working directory), staged changes (staging area), and committed (history).

Example

bash
# Stage only one file out of many changed
git add important-file.js
git commit -m "Fix important bug"

# The other modified files remain unstaged
git status  # shows remaining changes as unstaged

git add moves changes to the staging area; git commit saves only staged changes.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary