Terminal, repository, and status
Initialize in the right folder and understand untracked, modified, and staged states.
- Difficulty
- beginner
- Time
- 35 minutes
- Last verified
- 9/21/2026
What you will build
Initialize in the right folder and understand untracked, modified, and staged states.
Understand the idea first
Initialize in the right folder and understand untracked, modified, and staged states.
Build it step by step
cd my-learning-page
git init
git status
git add index.html
git status- Open the previous project and record its result.
- Type the example and complete: Create all three states and inspect each with status.
- Change one input, predict, then verify.
- Create and repair: If git init ran in a parent folder, stop and locate the actual
.gitdirectory.
Read the important lines
- Initialize in the right folder and understand untracked, modified, and staged states.
- Read input, processing, and output separately.
- Verify another input and an edge case.
Common mistakes and what to check
| Symptom | What to check |
|---|---|
| Unexpected result | If git init ran in a parent folder, stop and locate the actual .git directory. |
| Nothing changes | Save, verify paths, and read the first relevant Console error. |
Practice without copying
Create all three states and inspect each with status.
Check the answer after you try
Rebuild and explain the decisions. Check: If git init ran in a parent folder, stop and locate the actual .git directory.
Completion check
- I produced the required visible result
- I can explain the input, processing, and output
- I tested normal, edge, and failure cases