How to Check Repository State in Git (git status)

git status summarizes the current state of your working directory and staging area — which files are modified, staged, or untracked.

Published September 28, 2026

git status shows the state of your working directory and staging area: which files are modified, staged, untracked, and how your branch compares with its upstream.

How it works

It is the command you run most often. It tells you the branch, whether you are ahead or behind the remote and the next likely actions.

Use git status -s for a compact view.

Try it

git status -s
M app.js
A new.js
?? notes.txt

Practical examples

Full status

git status

Short status

git status -sb

Show ignored files too

git status --ignored

Branch tracking

Your branch is ahead of 'origin/main' by 2 commits.

Common mistakes

  • Committing without checking status first.
  • Ignoring untracked files that should be ignored.
  • Misreading M columns (staged vs unstaged).

Key takeaways

  • status = where things stand.
  • -sb is compact.
  • Run it before committing.

FAQ

What does ?? mean?

An untracked file.

What do the two M columns mean?

First is staged, second is unstaged.

More Git articles