Terminal GuideTerminal Guide

git status Command Guide

Check the state of your working directory and staging area

5 min readLast updated: January 19, 2026
Dai Aoki

Dai Aoki

CEO at init, Inc. / CTO at US & JP startups / Creator of WebTerm

Quick Reference

Basic

git statusShow working tree status
git status -sShort format output
git status -bShow branch info

Output Format

--shortShort format
--longLong format (default)
--porcelainMachine-readable

Filtering

-unoHide untracked files
-uShow untracked files
--ignoredShow ignored files

Downloadable Image Preview

Failed to generate preview

Basic Usage

The git status command displays the state of the working directory and the staging area. It shows which changes have been staged, which haven't, and which files aren't being tracked by Git.

bash
# Basic status check
git status

# Short format output
git status -s

# Show branch and tracking info
git status -sb

Understanding the Output

The output of git status shows several categories of files:

bash
$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   src/app.js
        new file:   src/utils.js

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        config.json

File Status Categories

  • Changes to be committed: Files in the staging area, ready for commit
  • Changes not staged: Modified tracked files not yet staged
  • Untracked files: New files Git doesn't track yet

Common Options

OptionDescription
-s, --shortGive output in short format
-b, --branchShow branch and tracking info in short format
--porcelainMachine-readable output format
-u, --untracked-filesShow untracked files (all, normal, no)
--ignoredShow ignored files
-v, --verboseShow staged changes in diff format

Short Format

The short format uses two-letter status codes:

bash
$ git status -s
M  src/app.js       # Modified and staged
 M README.md        # Modified but not staged
A  src/utils.js     # Added (new file staged)
?? config.json      # Untracked file
MM src/index.js     # Modified, staged, then modified again
CodeMeaning
??Untracked file
AAdded (new file)
MModified
DDeleted
RRenamed
!!Ignored file (with --ignored)

Practical Examples

bash
# Check status before committing
git status

# Quick status check with branch info
git status -sb

# Check status of specific path
git status src/

# Show ignored files
git status --ignored

# Use in scripts (stable output)
git status --porcelain

# Verbose output with diff
git status -v

# Hide untracked files
git status -uno

Frequently Asked Questions

What does "Changes not staged for commit" mean?

This means you have modified files that are tracked by Git, but you haven't added them to the staging area yet. Use "git add <file>" to stage them for the next commit.

What does "Untracked files" mean?

Untracked files are new files that Git doesn't know about yet. They haven't been added to the repository. Use "git add <file>" to start tracking them.

How do I see only staged changes?

Use "git diff --staged" or "git diff --cached" to see only the changes that have been staged for commit.

What is the difference between -s and --porcelain?

Both provide short output, but --porcelain guarantees stable output format across Git versions, making it ideal for scripts. -s is for human readability.

How do I check status of a specific file?

Run "git status <filename>" to see the status of a specific file only.

Summary

git status is one of the most frequently used Git commands. It helps you understand what's happening in your repository before making commits.

Quick Reference

  • git status - Full status output
  • git status -s - Short format
  • git status -sb - Short format with branch
  • git status -uno - Hide untracked files
  • git status --porcelain - Script-friendly output

Official Documentation

For authoritative information, refer to the official documentation:

Related Articles