Manuals / Git & GitHub / Chapter 2
A · Daily · beginner · Day 1–2 · Chapter 2 of 12
Daily loop: status, diff, add, commit
Working tree → staging (index) → local history → remote. status and diff before every commit.
Path progress11%
Step 1 of 3
Three trees
Working directory (edited files), staging area (git add), repository (git commit). status shows all three.
Example
git status
git diff
git add README.md
git diff --staged
git commit -m "docs: explain three trees"
git log --oneline -5Do this now
Edit README. status. diff. add. diff --staged. commit. log --oneline.
Was this step clear?
Chapter learning outcomes
- Working tree vs staging vs history
- git status / diff
- git add / commit
- Commit messages
Clear these before you leave
Side quest
Commit hygiene
Fix typo in separate commit from feature work.