Staging Area

The staging area (also called the index) is where Git holds the changes you've selected for your next commit. You move changes into it with git add before committing.

Git & DevOps

The staging area is what makes Git commits deliberate: instead of saving every edit, you choose exactly which changes go into each commit. This lets you group related changes together.

The flow is: edit files in your working directory, git add them to the staging area, then git commit to save them permanently.

Syntax

git add <file>

Examples

Bash

git add styles.css
git status

Output:

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   styles.css

Learn it in a lesson

See also

Back to the Dictionary