Working together on GitHub · lesson 3 of 7
Commands and ideas in this lesson
AFiles changedthe pull request's diff
BSuggested changea fix the author accepts with a click
CComment, Approve, Request changesthe three ways to finish a review
DReading a difffrom lesson 2.2

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.

Screenshot of the Files changed tab of the same pull request, with numbered callouts. The numbered list below describes each part.
  1. Files changed tab. How many files the pull request changes. The other tabs are the conversation, its commits and its checks.
  2. File tree. Every changed file. Click one to jump to it.
  3. 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.
  4. Hunk header. @@ -1,8 +1,9 @@: where this part of the file starts, before and after, as in git diff.
  5. Removed lines. Red, with a minus: lines the pull request takes out.
  6. Added lines. Green, with a plus: lines it puts in. Two columns of line numbers show where each line is, before and after.
The Files changed tab of a pull request on GitHub. Screenshot of github.com, captured on 5 December 2026, signed out. GitHub changes its pages often, so yours may look a little different; the names in the list stay the same.

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 the Files changed tab of the same pull request. Each part you can choose is a button, listed in reading order.

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:

  1. Summary. One or two sentences on the whole pull request. Start with what’s good.
  2. Comment. You have questions or thoughts, but aren’t deciding.
  3. Approve. You read every line and you’d be happy for it to be in main. Your name goes on it.
  4. Request changes. Something must change first, such as a wrong amount. When the author pushes a fix, review again.
Finishing a review on GitHub. The course’s own drawing of this GitHub screen, with GitHub’s names for each part. A screenshot from the course’s demo account will replace it.

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

  1. “This is wrong.”

  2. “Lola’s notebook says 1.5 kg oxtail for 6, not 1 kg. Suggestion below.”

  3. “Why do you always forget the bagoong?”

  4. “Could we add how long to simmer the oxtail? The steps jump from boiling to serving.”

  5. “LGTM” (looks good to me), on a pull request with 400 changed lines, two minutes after it was opened

  6. “Nice: the ingredients now match the order of the steps. Approving.”

Spot the trap: approving without reading

Spot the trapAna

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

You know exactly what a changed line should say. What’s the most useful comment?
A pull request has a wrong amount that must be fixed before merging. Which review choice?
Why finish a review with Submit review instead of posting each comment straight away?

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.

All sources for Simple Git