Reviewing on GitHub
Last updated
A review is where a pull request gets better, or where a mistake gets caught before it reaches main. In this lesson you'll read a real pull request's changes on GitHub, see where to comment on one line, suggest a change the author can accept with a click, and choose between comment, approve and request changes, kindly and usefully.
By the end of this lesson you can
- Read a pull request's Files changed tab, and comment on a single line
- Write a suggested change the author can accept with one click
- Choose between Comment, Approve and Request changes, and write comments that help
Files changed
A pull request's Files changed tab is its diff (lesson 2.2): every file it changes, with removed lines in red and added lines in green. This is a real pull request that fixes mistakes in a tutorial about git reset and git revert.
- Files changed tab. How many files the pull request changes. The other tabs are the conversation, its commits and its checks.
- File tree. Every changed file. Click one to jump to it.
- File header. The file’s path, and how many lines were added and removed. The box at the far right marks it as viewed, so a long review can be done in parts.
- Hunk header.
@@ -1,8 +1,9 @@: where this part of the file starts, before and after, as ingit diff. - Removed lines. Red, with a minus: lines the pull request takes out.
- Added lines. Green, with a plus: lines it puts in. Two columns of line numbers show where each line is, before and after.
Read it the way the person who'll use it will. For a recipe, that's a cook: are the amounts right, is anything missing, would the steps work?
Find it
To comment on one line, hover over it: a blue + appears beside its line number. Click it (or drag across several lines) and write.
Find it 1 of 1
You want to ask about one of the new lines. Where do you hover to add a comment on it?
Screenshot of github.com, captured on 5 December 2026, signed out. Yours may look a little different.
Suggesting a change
When you know exactly what a line should say, don't describe it: suggest it. In a line comment, the ± button (Add a suggestion) fills in a block you can edit:
Lola uses ground peanuts, never peanut butter.
```suggestion
- 1 cup ground roasted peanuts
```The author sees your new line as a diff, with a Commit suggestion button. One click makes a commit on their branch with your change, and the pull request updates. Several suggestions can be committed together.
Suggestions only work for lines the pull request changed or is near. For anything bigger, say what and why in words, and let the author make the change.
Finishing the review
Comments you write while reviewing are kept as pending until you finish. Review changes (or Submit review) sends them all at once, with a summary and one of three choices:
- Summary. One or two sentences on the whole pull request. Start with what’s good.
- Comment. You have questions or thoughts, but aren’t deciding.
- Approve. You read every line and you’d be happy for it to be in main. Your name goes on it.
- Request changes. Something must change first, such as a wrong amount. When the author pushes a fix, review again.
If the repository has a rule requiring an approval (lesson 7.4), the merge button stays grey until someone with write access approves.
Helpful or not?
A good review comment is specific, says why, and is about the change, not the person. Sort these comments on Carla's kare-kare pull request:
0 of 6 placed right
“This is wrong.”
“Lola’s notebook says 1.5 kg oxtail for 6, not 1 kg. Suggestion below.”
“Why do you always forget the bagoong?”
“Could we add how long to simmer the oxtail? The steps jump from boiling to serving.”
“LGTM” (looks good to me), on a pull request with 400 changed lines, two minutes after it was opened
“Nice: the ingredients now match the order of the steps. Approving.”
Spot the trap: approving without reading
Joaquin’s pull request “Fix typos” is waiting. Ana trusts him, so she presses Approve from the Conversation tab without opening Files changed.
What happens if…
Check what you learned
Sources
Every command on this page behaves as these pages describe, and the sandbox prints what Git 2.55 prints. Hosting features (pull requests, protected branches) come from the host’s own documentation.
- GitHub Docs: Commenting on a pull request: comments on lines, and suggested changes
- GitHub Docs: Incorporating feedback in your pull request: accepting suggestions as commits
- GitHub Docs: About pull request reviews: comment, approve, request changes
- GitHub Docs: Approving a pull request with required reviews: when an approval is needed before merging