learn git.
0/25 done
learn git/the basics/course 05 of 25

git status: your best friend

The command you will run more than any other. Learn to read it once, benefit forever.

6 min read·3 sections·3 tasks
the key idea

git status never changes anything — it is a pure question: where does every file stand right now?

01What status tells you

At any moment, git status reports three groups of files, and the group names are the entire vocabulary you need. Untracked files are new — git has never photographed them, so it politely ignores them until you say otherwise. Staged changes are on the checklist, ready for the next photograph. Unstaged changes are files git has photographed before but that have drifted — edited since their last photograph.

And when there is nothing to report, git says nothing to commit, working tree clean — every file's current state is safely in the album. Clean is the state you leave your project in when you finish work for the day.

  • —Untracked — brand new, never photographed
  • —Changes to be committed — staged, going into the next photograph
  • —Changes not staged — photographed before, modified since
  • —nothing to commit, working tree clean — everything saved

02The hints in brackets are for you

Under each group, git prints lines like (use "git add <file>..." to include in what will be committed). These are not decoration — they are git literally telling you the next command to type, for your exact situation. Beginners skim past them; people who read them never get stuck. When you feel lost at any point in this course, run status and read the hints out loud.

[bash]· run it before and after everything
git status
The reflex to build

Do something, status. Before adding, status. Before committing, status. After committing, status. It costs half a second and it means nothing in git will ever surprise you.

03A status report you should be able to read

Here is a real one, annotated. The first line tells you where you are standing — the branch, which for now is always main. Then the groups follow, one block each, ending with the summary sentence that tells you whether a commit would do anything right now.

[bash]· one staged file, one untracked — read it slowly
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	new file:   notes.txt

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

nothing added to commit but untracked files present
new file versus modified

The label beside a staged file says new file the first time it enters a photograph, and modified every time after that. Same pipeline, different label for first-time versus repeat.

>>

Practice

A fresh repository, one task: make a file and see what git calls it.

[practice]· a real terminal, safely simulated
practice terminal — everything here is simulated, nothing can break
type 'help' to see the commands this terminal understands
~/my-project (main) $
Your tasks0/3 done
  1. 01.Create a file called notes.txt with any text.

    hint: Try: echo "my notes" > notes.txt

  2. 02.Run git status.

    hint: Type: git status

  3. 03.Your file should be listed as untracked.

    hint: git status groups new files under 'Untracked files' — create notes.txt if it is not there yet.