Status → branch → diff → commit
A branch isolates a line of work. Inspect status before changing branches, review the diff, stage only intended files, and commit a coherent change.
What is it?
A branch isolates a line of work. Inspect status before changing branches, review the diff, stage only intended files, and commit a coherent change.
Why it matters
Reviewable history supports collaboration and recovery.
When to use it
Before editing a shared or valuable codebase.
How to do it
- Read the explanation and identify the files or environment involved.
- In a disposable Git repository, run git status, create a branch with git switch -c practice-heading, edit one heading, and run git diff. Review before staging that file and committing.
- Compare the result with the verification criteria below. Record what worked and what remains unclear.
Worked example
In a disposable Git repository, run git status, create a branch with git switch -c practice-heading, edit one heading, and run git diff. Review before staging that file and committing.
Try it yourself
Repeat the exercise with your own wording or a second sample. Use the smallest change that demonstrates the idea.
Prompt builderVerify your result
git show --stat displays only the intended files; git status makes remaining uncommitted work visible.
Common mistakes
Staging everything without checking for secrets or other people’s changes. Stage named files only.
How to recover
Stop at the first unexpected result. Preserve your current work, re-check the named file or environment, and repeat only the failing step. Ask for an explanation if the recovery is unclear.
Official references
Product interfaces and access can change. Use the linked official guide for current installation and account requirements.
Git · diff ↗Git · switch ↗Git · revert ↗Source review: 2026-09-16