← Back to Mission Control

Systems Check

7 min read

Git Status

Mission Phase 9 • Difficulty: Beginner

Checking Your Spacecraft Systems

Before any launch, astronauts run systems checks. In Git, git status is your diagnostic command—it tells you exactly what's happening in your repository.

The Status Command

git status

This command shows:

Understanding the Output

When you run git status in a new repository with one file, you might see:

On branch main

No commits yet

Untracked files:
  (use "git add ..." to include in what will be committed)
        README.md

nothing added to commit but untracked files present (use "git add" to track)

Let's decode this:

File States in Git

Files can be in several states:

Untracked

New files Git doesn't know about yet. They exist but aren't in version control.

Unmodified

Files tracked by Git that haven't changed since the last commit.

Modified

Tracked files that have changed but aren't staged for commit.

Staged

Files marked for inclusion in the next commit.

Status After Adding Files

After running git add README.md:

On branch main

No commits yet

Changes to be committed:
  (use "git rm --cached ..." to unstage)
        new file:   README.md

Now README.md is in the staging area, ready for your first commit.

Short Status

For a condensed view:

git status -s

Output looks like:

A  README.md
M  script.js
?? new-file.txt

Codes:

Why Status is Essential

Run git status often. It's your mission control readout, showing exactly what's happening. Before committing, pushing, or pulling, check status first.

Pro Tip: Many developers run git status dozens of times per day. It's muscle memory. There's no such thing as checking status too often.

Status in Different Scenarios

Clean Working Directory

On branch main
nothing to commit, working tree clean

All changes are committed. Systems are green.

Modified Files

Changes not staged for commit:
  modified:   navigation.js

You've changed files but haven't staged them.

Files Ready to Commit

Changes to be committed:
  new file:   thrusters.py
  modified:   fuel-system.js

Files are staged and ready for commit.

Practice Exercise

  1. Run git status in your repository
  2. Create a new file: touch flight-log.txt
  3. Run git status again—see the difference?
  4. Edit README.md
  5. Run git status once more

Watch how status changes as you modify your project.

Next: The Staging Area

Now you can check your system status. Next, we'll learn about the staging area—the launch pad where you prepare files for commit.