Start from a known tree
Before editing, inspect git status and state that unrelated changes must be preserved. In shared repositories, one branch or worktree per task reduces collisions.
git status --short git diff --stat Preserve existing changes that do not belong to this task. If they touch the same file, integrate with them without overwriting them.
Review like a maintainer
Use /review or request an explicit review. A useful review prioritizes behavior bugs, security, regressions, and missing tests; style comes later.
/review Review the diff against main. List findings by severity with file and line. Look for regressions, edge cases, security issues, and missing tests.
One idea per commit
Ask Codex to inspect the staged scope, run checks, and draft a message describing the outcome. Do not mix unrelated fixes in the same commit.
Before pushing
- The Git author uses an email accepted by the remote provider.
- No secrets, large artifacts, or accidental files are included.
- The commit contains only the reviewed scope and relevant checks pass.
Lesson deliverable
What you will build
Practical evidence for "Work with Git and review changes" applied to a real or training repository.
Why it matters
The goal is to turn the lesson into a verifiable action, not just reading.
Starter repository or files
A small Git repository with Git, README, and one known validation command.
Steps
- 1. Inspect Git status before starting.
- 2. Ask Codex to work with limited scope.
- 3. Run the verification command.
- 4. Review the diff or produced evidence.
- 5. Record what is verified and what remains open.
Copy-ready Codex request
Apply the lesson "Work with Git and review changes" in this repository. Work in small changes, cite concrete files, run one verification, and finish with evidence and risks.
Expected result
A reviewable output: map, plan, diff, test, or report depending on the lesson.
Verification command
git status --short && git diff --stat
Manual check
Check that the result matches the requested scope and Codex did not touch unrelated files.
Mini exercise
Repeat the practice in another folder of the same repository, changing only one constraint.
Show solution
Keep the same goal, add one explicit constraint, and compare whether the final evidence improves.
Evidence to save
Save the prompt, commands run, relevant output, and git diff --stat.