Git Academy

Intermediate · 6 min read

Reviewing a pull request well

Test it locally, comment usefully, approve or request changes — and receive a review without suffering.

Get the PR on your machine

Reading the diff isn't always enough: run it. With the GitHub CLI or with plain Git (the PR number is in its URL).

Safe
$ gh pr checkout 123
# or: git fetch origin pull/123/head:pr-123 && git switch pr-123

What to look at

Does it do what the description says? Edge cases, errors, security (secrets, user input), tests, names that explain themselves. Style issues: let the linter handle them.

Comment like a human

Ask questions (“what happens if…?”), explain why, and say what blocks (must fix) and what's optional (nit:). GitHub's “Suggestion” lets the author apply your fix in one click.

See what changed since your last review

After a force push, range-diff compares the old and new version of the branch, commit by commit.

Safe
$ git range-diff origin/main old-head new-head

Receiving a review

Comments are about the code, not about you. Answer each one, push fixes as new commits during review, and re-request a review when done.