Skip to content
Learn Netverks

Lesson

Step 2/5 40% through track

working-tree

Working tree and staging

Last reviewed May 28, 2026 Content v20260528
Track mode
none
Means
Read / quiz
Reading
~1 min
Level
beginner

This lesson

This lesson covers Working tree and staging as part of the Git track.

Version control is required for every professional codebase—this track builds habits before framework magic.

Pull requests, CI pipelines, open-source contributions, and local feature branches.

Read the lesson, run the copy-paste commands in your terminal, then verify with the self-check and MCQs.

Before collaborating on team repos or applying to junior roles.

Git sees three main states: modified in your working tree, staged in the index, and committed in history.

Typical flow

git status          # see modified paths
git add file.txt    # stage changes
git commit -m "..."  # record snapshot

Why staging exists

You can craft a commit from part of your edits—useful when a bugfix and a refactor happened in the same afternoon.

Self-check

  1. What does git add -p help you do?
  2. How is the staging area different from the last commit?

Interview prep

What is the difference between the working tree and the staging area (index)?

The working tree is the files you edit on disk. The staging area holds the next snapshot you intend to record—populated with git add—before you run git commit.

What does <code>git add</code> actually do?

It stages a snapshot of the path into the index so the next commit records that version—not every edit in your folder until you commit.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What part of this lesson needs a second read?
  • What would you try differently in a real project?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump