Code review best practices on GitHub
Code review best practices for GitHub: small pull requests, clear descriptions, fast turnaround, automated checks and kind, specific comments.
On this page
Good code review on GitHub rests on a few habits: keep pull requests small, describe them well, let automated checks catch the mechanical problems, review within a day, comment on the code rather than the person, and be explicit about what's required versus optional. Together they make reviews faster, catch more real issues and keep the team moving.
For authors
Keep pull requests small. Small changes are reviewed faster and more carefully. If a change is large, split it into steps that each make sense on their own. See how big should a pull request be?
Write a useful description. Say what the change does and why, how to test it, and anything reviewers should look at closely. Link the issue. Screenshots help for interface changes.
Self-review first. Read your own diff before requesting review. Remove debugging leftovers, add comments where intent isn't obvious.
Use drafts for early feedback. A draft pull request signals "not ready to merge" while still letting people comment. See draft pull requests on GitHub.
Request the right reviewers. One or two people who know the code, not the whole team. See GitHub reviewers vs assignees.
For reviewers
Review promptly. A pull request waiting days loses context for its author and blocks other work. Aim to respond within a working day, even if only to say when you'll review. See how to review pull requests faster.
Start with the big picture. Goal, approach and design first; line-level details after. A checklist helps: see a pull request review checklist.
Be specific and kind. "This loop runs once per item and calls the API each time; could we batch it?" is more useful than "this is slow". Ask questions when you're unsure.
Label optional comments. Prefix suggestions you don't insist on, for example with "nit:" or "optional:", so the author knows what blocks approval.
Approve clearly. If it's good to merge, approve, even with optional suggestions. Don't leave authors guessing.
Let automation handle the mechanical parts
Formatting, linting, type checks and tests belong in CI, not in review comments. When checks run on every pull request, reviewers can focus on design and correctness. Make important checks required before merging. See GitHub Actions and status checks, explained.
Team agreements worth writing down
| Agreement | Example |
|---|---|
| Review turnaround | First response within one working day |
| Required approvals | One approval, two for sensitive areas |
| Who reviews what | CODEOWNERS for ownership areas |
| Pull request size | Prefer small; split large changes |
| Comment conventions | "nit:" for optional suggestions |
When reviews go wrong
- Endless back-and-forth: move to a quick call or a short written proposal; agree, then update the pull request.
- Rubber-stamp approvals: if approvals come without comments on complex changes, ask reviewers to note what they checked.
- Bikeshedding over style: add the rule to a linter or formatter and stop discussing it in reviews.
- One reviewer for everything: spread reviews with CODEOWNERS or team review requests. See team review requests on GitHub.
Make the queue visible
Reviews slip when nobody sees the queue. Check GitHub's review-requested search at set times, or keep it in view. OneNotch shows pull requests waiting for your review in the notch, with check summaries and approval counts, and a Reviews waiting count on its Home screen. When one is ready, press V to open its changes on GitHub, and approve from the notch with A twice once you've reviewed it.
FAQs
How many reviewers should a pull request have?
Usually one or two who know the code. More reviewers often means slower, shallower reviews.
How fast should code reviews happen?
Many teams aim for a first response within one working day.
Should reviewers fix small issues themselves?
GitHub's suggestion feature lets reviewers propose exact changes the author can accept, which is a good middle ground.
What should never be in a review comment?
Personal criticism. Comment on the code and its effects, not the author.