Three Real Files, One Working Session
# edit cookies.md, create pasta.md and soup.md
git status
git genuinely tracks each file's own state independently — one modified, two untracked — all visible in a single real status report.
Stage Only What Belongs Together
git add cookies.md pasta.md
git diff --staged
git diff --staged shows the exact real content queued for the next commit — both files, and only those two, even though a third file is also genuinely dirty on disk right now.
Commit, Then Come Back for the Rest
git commit -m "Add ingredients list and pasta recipe"
git status # soup.md is still genuinely untracked
git add soup.md
git commit -m "Add chicken noodle soup recipe"
Two real, separate commits — each one containing exactly what its message describes, not an incidental dump of everything that happened to be dirty at the time.
Your recipe collection is growing. In one real sitting you add ingredients to the cookie recipe, write a new pasta recipe, and write a new soup recipe — three genuinely different files, all dirty at once.
The temptation is to stage everything and commit it all as one lump. This lesson does the opposite, on purpose: stage exactly two of the three, commit that pair with a message that describes what it actually contains, then come back for the third file separately. git status and git diff --staged are your real, live mirrors at every step, confirmed directly rather than assumed.
Selective staging
Running git add on only some of the files that are currently dirty, even when other files are also genuinely modified or untracked at the same time. Confirmed directly in this lab: git diff --staged only ever shows the files actually staged, never the ones left out.
A commit as a choice
A commit genuinely only ever contains what was staged at the moment git commit ran — not "everything that changed today." Real, disciplined commits are built by choosing what belongs together, not by accepting whatever happens to be dirty.
Takeaways
- git status genuinely reports each dirty file's own real state independently — modified, untracked, or staged
- git add accepts multiple files at once, staging exactly the ones named — nothing else
- git diff --staged shows precisely what the next commit would contain, confirming what was (and was not) staged
- A commit is a real, deliberate choice about what belongs together — not an automatic dump of every current change
- Leaving a file uncommitted is genuinely fine — it just sits there, untracked or unstaged, until you are ready for it