Skip to main content
Working with Changes

git status

Show the current state of the working tree and staging area

Practical Example

git status
# On branch main
# Changes not staged for commit:
#   modified:   src/index.ts
# Untracked files:
#   new-feature.ts

Command Overview & How It Works

Compares the working directory, staging area (index), and the most recent commit to show exactly what is tracked, modified, staged, or untracked. Files appear in three sections: 'Changes to be committed' (staged), 'Changes not staged for commit' (modified but not staged), and 'Untracked files' (new files Git does not know about). Use git status -s (short format) for a concise two-column output ideal for scripting. Use git status -b to always show branch information. Run this command frequently — it is the safest way to understand your repository state before committing, merging, or switching branches. Unlike git diff, it does not show the actual content changes, only the file names and their status.

Practical Tips

  • Run git status before every commit, merge, or branch switch to avoid surprises.
  • Use git status -s for a concise, scripting-friendly output with one line per file.
  • Use git status -sb to also show branch tracking and how many commits you are ahead of or behind the remote.

Related Commands in Working with Changes