The Three Areas
Create a file, stage it, and ask the honest question: if this VM crashed right now, is this file actually safe?
Your repository exists, but it is still genuinely empty — no history at all. In this lab you add a real recipe file and watch it move through git's three real areas: the working directory (an ordinary file on disk), the staging area (marked for the next commit, but not committed), and — not yet reached in this lab — history.\n\nAlong the way, ask the honest question the curriculum poses directly: if this VM crashed right now, is this file actually safe? The answer, checked directly rather than assumed, is genuinely no — until it is committed.
The Three Real Areas
1. Working directory an ordinary file, exactly like any other file on disk
2. Staging area marked "include this in the next commit" — not committed yet
3. History a real, permanent commit — genuinely safe
Working Directory: Just a File
echo "Chocolate Chip Cookie Recipe" > cookies.md
git status
Untracked files:
(use "git add <file>..." to include in what will be committed)
cookies.md
git genuinely sees the file exists, but is not tracking its content in any way yet. It is an ordinary file on an ordinary filesystem — nothing about it is backed up by git.
Staging: Marked, Not Saved
git add cookies.md
git status
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: cookies.md
git diff --staged shows exactly what is queued for the next commit:
diff --git a/cookies.md b/cookies.md
new file mode 100644
+Chocolate Chip Cookie Recipe
The Honest Answer
Right now — staged, but not committed — there is still no commit in this repository's history that includes
cookies.md. git log would genuinely show nothing at all. Staging is a real, useful checkpoint for building up
exactly what a commit should contain, but it is not the safety net — only a real commit is.
Working directory
The ordinary files on disk that make up your project right now. Git can see them, but a file sitting only in the working directory has no git history protecting it at all.
Staging area (the index)
A real, separate checkpoint where changes are marked "include this in the next commit" via git add, before the commit itself is actually made. Confirmed directly in this lab: git status genuinely distinguishes staged changes from untracked and unstaged ones.
git diff --staged
Shows the exact content difference between the last commit and what is currently staged — the precise, real content that the next git commit would record.
📝 Create a File and Observe It Untracked
Add your first recipe, then check git status to see how git describes a file it has never seen before.
cd ~/recipes && echo Chocolate Chip Cookie Recipe > cookies.mdcd ~/recipes && git statusstudent@lab:~$ cd ~/recipes && echo Chocolate Chip Cookie Recipe > cookies.md student@lab:~$ cd ~/recipes && git status On branch master No commits yet Untracked files: (use "git add <file>..." to include in what will be committed) cookies.md nothing added to commit but untracked files present (use "git add" to track)
➕ Stage the File
Move the file into the staging area with git add, marking it for the next commit.
cd ~/recipes && git add cookies.mdstudent@lab:~$ cd ~/recipes && git add cookies.md
✅ Confirm It's Staged
Run git status again and see exactly how staged looks different from untracked.
cd ~/recipes && git statusstudent@lab:~$ cd ~/recipes && git status On branch master No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: cookies.md
🔬 See Exactly What Will Be Committed
Use git diff --staged to see the precise content queued for the next commit — and consider the honest safety question.
cd ~/recipes && git diff --stagedstudent@lab:~$ cd ~/recipes && git diff --staged diff --git a/cookies.md b/cookies.md new file mode 100644 index 0000000..07a904e --- /dev/null +++ b/cookies.md @@ -0,0 +1 @@ +Chocolate Chip Cookie Recipe
Lab 1.1.3 complete. A real file, genuinely tracked through two of git's three areas:\n\n\n Working directory (untracked) : ✅ confirmed via git status\n Staging area (staged) : ✅ confirmed via git status + diff --staged\n History (committed) : ❌ not yet — genuinely still unsafe\n
Enable JavaScript to run the live terminal and track your progress.