Skip to content
Courses/Codex for programmers/Work with Git and review changes

Work with Git and review changes

Keep commits understandable and use Codex as a reviewer before publishing code.

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.

TerminalCode
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.

TerminalCode
/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.