Lesson 9 +10 XP

Git Status

git status is the command you will run the most. It tells you the current state of your repository.

Run it


bash
git status

What it tells you

  • On branch: which branch you are on.
  • No commits yet: you have not made your first commit.
  • Untracked files: new files Git has not seen.
  • Changes to be committed: staged files ready for a commit.
  • Changes not staged for commit: edited files that are not staged.

Example output


### On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
        modified:   index.html

Keep it short

If the output is long, use the short form:


bash
git status -s

It prints one short line per file. A file marked with ?? is untracked, A is added/staged, and M is modified.

When to check

Run git status:

  • before staging,
  • before committing,
  • after committing to confirm everything is saved,
  • any time you are unsure what is going on.

TL;DR

  • git status shows the state of your repository.
  • It flags untracked, staged, and modified files.
  • git status -s gives a short one-line summary.
  • The clean message means all changes are committed.