Tour of Git
Git Basics / Lesson 1.3

git status — Understanding the Working Directory

The git status command shows you the current state of your repository. It tells you:

  • Which files are untracked (new, not yet known to Git)
  • Which files are staged (ready to be committed)
  • Which files are modified (changed but not yet staged)

The Three States

Every file in a Git repository can be in one of three states:

Untracked → Staged → Committed
              ↑         |
              └─────────┘ (modify → stage again)
  • Untracked: Git doesn't know about this file yet
  • Staged: The file is in the staging area, ready for the next commit
  • Modified: The file changed since the last commit but isn't staged yet

Try it!

The repository is already initialized. Your task:

  1. Create two files: touch staged.txt untracked.txt
  2. Stage only one: git add staged.txt
  3. Run git status to see the difference

Notice how staged.txt appears under "Changes to be committed" while untracked.txt appears under "Untracked files".

Why is this useful?

Before committing, always run git status to verify exactly what will go into your commit. It's the most common Git command — you'll use it constantly.

🎯

Goal

Create two files, stage only one, and observe the status output

Terminal
$

No commits yet. Run `git init` and create your first commit.