ShareYourGroupShareYourGroupGit Help

What the staging area is

Git has a middle step between editing a file and committing it. Knowing it explains most confusing messages.

Three places

  1. Your working folder is the files you see and edit.
  2. The staging area (also called the index) is a list of the changes that will go into the next commit. git add copies a change into it.
  3. The commits are the saved history. git commit turns the staging area into a new commit.

You can stage part of your work and commit only that part. The rest stays in the folder, not yet saved.

The two letters in git status --short

git status --short prints two columns before each file name. The first is the staging area compared with the last commit. The second is your folder compared with the staging area.

You seeIt means
M (M, then a space)Modified and staged
M (space, then M)Modified, not staged
MMStaged, then changed again after staging
A New file, staged
??Not tracked by Git
UUBoth sides changed it (merge conflict)

The situations on this site show real examples: the page about unstaging a file prints M and ?? and the conflict page prints UU.

The commands

Why does Git not simply commit all my changes?

Because it lets you build clean commits: one commit for one idea.

What does git commit -a do?

It stages changes to files that Git already tracks and commits them in one step. It does not add new files.

Sources

  • Git documentation: git-reset (git-scm.com/docs/git-reset)
  • Git documentation: gitrevisions (git-scm.com/docs/gitrevisions)
  • Git documentation: git-config, settings gc.reflogExpire and gc.reflogExpireUnreachable (git-scm.com/docs/git-config)
  • Git documentation: git-revert (git-scm.com/docs/git-revert)

Read on 14 November 2026.

This is an independent guide. It is not connected with the Git project, GitHub, GitLab or any company named here. Every command below was run on 14 November 2026 with the real program (git version 2.56.0.windows.4) in a new empty practice repository; the output shown is what it printed. Facts about options were read in the official Git documentation on 14 November 2026.