Code review on GitHub
Intermediate GitHub UI
Why this matters
You will be reviewed constantly and asked to review more often than you expect: documentation, interface wording, error messages, release notes. The mechanics take five minutes to learn. The manner is what decides whether people want you on their pull requests.
The mechanics
Reviews are written on the Files changed tab. Hovering a line shows a comment icon; clicking it opens a comment box on that line.
| Action | What it does |
|---|---|
| Add single comment | Posts that comment immediately |
| Start a review | Holds it as a pending comment, visible only to you |
| Add review comment | Adds another to the batch you are building |
| Review changes → Submit review | Posts them all at once with a summary and a verdict |
| Viewed checkbox | Collapses a file you have finished and tracks progress |
Prefer Start a review for anything longer than a one-line fix: the author gets one notification instead of twelve, and you can revise a comment before anyone sees it.
The Viewed checkbox is underrated on a large pull request. It collapses each file as you finish it and remembers, so an interrupted review can be resumed rather than restarted, and new commits un-tick the files they touch.
The three verdicts
| Verdict | Means |
|---|---|
| Comment | Feedback without a judgement; use it when you looked at part of it, or have questions |
| Approve | You are happy for it to merge |
| Request changes | Something must change first; this blocks the merge until you or another reviewer clears it |
Request changes is the one to use deliberately. It is right for a factual error or a broken step; it is heavy-handed for a preference, because the author cannot merge until you come back and re-review. For preferences, use Comment and say "non-blocking".
If a review requesting changes is holding up work and its author is unavailable, an Admin can dismiss it with a reason, which is recorded on the pull request.
Suggestions
For anything that is "this word should be that word", write a suggested change rather than a sentence describing it. In the comment box, the suggestion button inserts a fenced block pre-filled with the selected lines:
```suggestion
Yes. Trailguide is free for everyone, including commercial use.
```The author sees a diff and a Commit suggestion button, or can collect several with Add suggestion to batch and commit them together. This is the most useful review skill for documentation work: unambiguous, one click, and the resulting commit credits you as co-author.
Writing a comment that helps
| Instead of | Write |
|---|---|
| "This is wrong." | "This says 3.9, but the workflow pins 3.12 — should it be 3.12?" |
| "Reword this." | A suggestion containing the wording you mean |
| "Why did you do it this way?" | "What made you choose X over Y? I ask because…" |
| Twelve separate comments | One review, batched, with a summary |
Three habits make a reviewer easy to work with. Mark what is optional with "nit:" or "non-blocking:", so the author knows what must change. Say one good thing, briefly; it changes how the rest reads. Review promptly or say when you can, because a pull request waiting two days is a person blocked for two days.
Being reviewed
- Read the whole review before replying. Half the comments often answer each other.
- Answer every thread, even with "done" or "kept as is, because…". Silence reads as ignoring.
- Push fixes as new commits rather than amending, so the reviewer can see what changed since they looked. The squash on merge tidies it anyway.
- Re-request review from the sidebar once you have addressed everything; that is what returns it to their queue.
- Resolve conversation on threads you have acted on, if the repository requires resolution before merging.
Reviewing as a non-developer
You are qualified for more than you think, and not for some of it, and saying which is which is the professional move.
| You can usefully check | Say it like this |
|---|---|
| Wording, clarity, grammar, tone | Just comment or suggest |
| Whether the docs match what the change does | "The code now defaults to 10 but the guide still says 5" |
| Whether an error message will make sense | "A user seeing this will not know what 'nil ref' means" |
| Whether the change is documented at all | "Should this be in the changelog?" |
| Steps a user follows, by following them | "I followed these on Windows and step 3 failed" |
For the rest, say so: "I reviewed the documentation only; the Python needs someone else." That is a useful review, and it stops your approval being read as more than it was.
How to do it
Review happens on the platform, but checking out the branch is what makes a documentation review real:
$ git fetch
$ git switch docs/12-windows-install-stepsFor a pull request from a fork, gh pr checkout 42 fetches it in one step. Following the steps yourself is the most valuable review a writer can give.
The GitHub Pull Requests and Issues extension shows the diff and threads in the editor, supports pending comments and suggestions, and can submit a verdict. Its advantage is the surrounding file, which the web diff hides.
The Pull Requests tool window lists them, shows the diff and threads, and supports commenting, suggesting and approving with full editor context.
The same mechanics with different labels: Changes instead of Files changed, Start a review and Submit review, Approve, and suggestions written in a suggestion fence with an Apply suggestion button. GitLab has no blocking "Request changes" verdict; unresolved threads do that job. See lesson 9.8.
- Open the pull request, go to Files changed.
- Hover a line, click the comment icon, and choose Start a review if you expect to leave more than one.
- Use the suggestion button for wording changes.
- Tick Viewed on each file as you finish it.
- Review changes → summary → Comment, Approve or Request changes → Submit review.
- As the author: answer every thread, push fixes, resolve conversations, and re-request review.
Common mistakes
- Twelve separate comments instead of one batched review.
- "Request changes" for a preference, which blocks the merge until you return.
- "Reword this" without saying how. Use a suggestion.
- Approving without saying what you looked at, which implies more than you checked.
- Leaving threads unanswered as the author.
- Force-pushing mid-review, which detaches the comments from the commits they referred to.
- Reviewing only the diff when the change is a set of instructions. Follow them.
Try it yourself
Goal: give a real review, including a suggestion, and see both sides.
- On your practice repository, create a branch with a deliberate typo and a factual error in
docs/faq.md. - Push it and open a pull request.
- Review it: on Files changed, start a review, add a suggestion for the typo and a comment explaining the factual error, tick Viewed, and submit as Comment.
- Switch hats: commit the suggestion, fix the fact, answer and resolve the threads.
- Look at the commit the suggestion created and note who it credits.
Expected result: one batched review, one committed suggestion co-authored by the reviewer, and threads answered and resolved.
Show solution
Step 5 is the point. An applied suggestion credits the reviewer as co-author, which is why suggestions are the courteous way to fix someone's wording rather than pushing to their branch. Reviewing your own pull request is artificial, but it is the only way to see both sides of the mechanics in ten minutes.