Getting Started Git Basics Staging area

Staging area

Understand the Git staging area, what it is for, and how it controls what goes into the next commit.

The staging area holds the changes you have selected for the next commit.

It is sometimes also called the index.

Why Git has a staging area

Git does not force every file change in your worktree into the next commit.

Instead, it gives you a step in between editing and committing. That step is the staging area.

This is useful because it lets you:

  • Review what should go into the next commit.
  • Commit only part of your current work.
  • Keep unrelated changes in separate commits.
  • Build cleaner, more focused history.

Without the staging area, every commit would have to include all current worktree changes at once.

Worktree vs staging area

The worktree contains your current local edits on disk.

The staging area contains the exact changes Git will use to create the next commit.

That means a file can be:

  • changed in the worktree but not staged yet
  • staged for commit
  • partly staged and partly unstaged

This separation is a core part of how Git works.

Staging all changes vs selected changes

Sometimes you want to stage everything you changed. Other times you want only a subset.

For example, you might:

  • Stage all files when one task is complete and everything belongs together.
  • Stage only one file if the others are unrelated.
  • Stage only part of a file if you made two separate changes in the same file and want separate commits.

Good commits are usually easier to understand when each commit contains one clear change. The staging area helps you build commits that way.

What happens when you commit

When you create a commit, Git uses the staged content, not the entire worktree.

That means:

  • Staged changes go into the new commit.
  • Unstaged changes stay in your worktree.
  • You can continue working after the commit without losing those unstaged edits.

Staging in GitComet

GitComet gives you controls to move changes into and out of the staging area.

That lets you:

  • Stage a whole file.
  • Unstage a file you no longer want in the next commit.
  • Review the staged diff before committing.

If you are unsure what will be committed, the safest thing to check is the staged state, because that is what Git will use when the commit is created.

Documentation

Search

move open Esc close

Browse the docs or start typing to filter results.