Blog

How to review and approve a pull request on GitHub

Comment on lines, suggest exact changes, submit Comment, Approve or Request changes, and see how CODEOWNERS and required reviews decide what can merge.

Alex Mercer

To review a pull request on GitHub, open its Files changed tab, hover over a line and click the blue + to comment, and choose Start a review so your comments go out together. When you've gone through every file, click Submit review above the changed code, write a short summary, choose Comment, Approve or Request changes, and click Submit review again.

The steps below follow GitHub's current Files changed page, which GitHub started rolling out as the default for all users on January 22, 2026. If you're new to the practice itself, start with what code review is and how the process works.

The short version

  1. Read the description, the linked issue and the CI results.

  2. Open the Files changed tab.

  3. Hover over a line, click the blue +, write your comment and click Start a review. Shift-click line numbers to comment on a range.

  4. To propose exact code, insert a suggestion with Cmd+G (Mac) or Ctrl+G (Windows and Linux) and edit it.

  5. Select Viewed on each file when you finish it.

  6. Click Submit review above the changed code, write a summary, choose Comment, Approve or Request changes, and click Submit review again.

  7. When the author pushes fixes and re-requests your review, read the new commits and check your threads.

How to approve a pull request on GitHub

To approve a pull request, open its Files changed tab, click Submit review, write a short summary, select Approve and click Submit review. From a terminal, gh pr review 123 --approve does the same. Your approval counts toward required approvals only if you have write access to the repository.

To ask someone else for an approval, click Reviewers in the pull request sidebar and pick a person or team. You need write access to request a review, and the person you ask needs at least read access. GitHub's guide to approving a pull request with required reviews lists the merge rules that decide whose approval counts.

Before you open the diff

Step 1: Open the Files changed tab

Click the Files changed tab. A few settings make the diff easier to read:

  • Diff view. Click the gear to choose a unified or split view. GitHub applies your choice to other pull requests too.

  • Whitespace. Hide whitespace differences when a change re-indents code. This setting applies to the current pull request.

  • File filter and tree. Filter the file list, or use the file tree to jump to a file. Press T to move to the "Filter changed files" field.

  • Commits. Press C to open the Commits menu and filter which commits the diff shows.

The full list of shortcuts is in GitHub's keyboard shortcuts docs. If generated files bury the real change, mark them with the linguist-generated attribute in a .gitattributes file at the repository root, and GitHub hides them in diffs by default:

Step 2: Comment on a line or a range

Hover over a line and click the blue + next to it.

To comment on several lines, click the first line number, then Shift-click the last one (or drag down to it), and click the +. To comment on a whole file, click the comment icon to the right of the file.

Type your comment, then pick one of two buttons:

Button

What happens

Comment

Posts this single comment right away.

Start a review

Saves it as a pending comment that only you can see until you submit the review. Later comments use Add review comment.

Use Start a review for anything more than one note. Everyone watching the pull request or repository is notified of your comments, and batching them into one review avoids a notification per comment. You can edit pending comments until you submit.

Write comments the author can act on. A review comment might say:

This retries forever when the API returns a 500. Can we stop after three attempts and return the error?

Google's guide suggests explaining why and labeling severity: Nit: for minor points, Optional: (or Consider:) for ideas the author can skip, and FYI: for things that don't need action in this change.

Step 3: Suggest a change

When you know the exact fix, suggest it. Select the line or lines, start a comment, and click the Suggestion button (the file diff icon), or press Cmd+G on Mac or Ctrl+G on Windows and Linux. Edit the code inside the suggestion block that appears.

On a line that reads page_size = limit or 50, a comment with a suggestion might look like this:




The author can click Commit suggestion to apply it in its own commit, or Add suggestion to batch to collect several and apply them together with Commit suggestions. Either way, applying suggestions creates one commit on the pull request's branch. It takes write access to the repository, and everyone whose suggestion is included becomes a co-author of that commit.

Step 4: Mark each file as viewed

When you finish a file, select Viewed on the right of its header. The file collapses, and the progress bar in the pull request header shows how many files you've viewed. If the file changes later, GitHub clears the mark, so on a second pass you know which files to read again.

Step 5: Submit your review

Above the changed code, click Submit review to open the review panel. Some steps in GitHub's docs still use the button's older label, Review changes. Write a summary, choose a decision and click Submit review.

Decision

What it tells the author

Effect on merging

Comment

Feedback or questions, no verdict

None

Approve

Ready to merge

Counts toward required approvals when you have write access

Request changes

Address this before merging

Blocks merging only when a ruleset or branch protection rule requires a pull request and you have write access; then it holds until you approve, or until someone with write access dismisses your review

A few rules to know:

  • You can't approve your own pull request.

  • By default, repository owners and admins can merge without an approving review. Branch protection can be set to apply to them too.

  • To throw away a pending review and all its comments, open the review panel and click Discard review.

Approve is the formal version of LGTM. If that acronym is new to you, see what LGTM means.

Step 6: Re-review after new commits

When the author has addressed your comments, they click the Re-request review icon next to your name under Reviewers in the sidebar (GitHub's docs). On the second pass:

  • Start with the files that lost their Viewed mark. They changed since you looked.

  • Press C and select only the new commits.

  • Open the Conversations menu on the Files changed tab to see which threads are unresolved, resolved or outdated.

  • Click Resolve conversation on threads that are done. The pull request author and anyone with write access can resolve them.

If the repository dismisses stale approvals, a push that changes the diff removes earlier approvals, so the pull request needs a fresh approval before it can merge.

How CODEOWNERS and required reviews fit in

Two pieces of repository configuration decide who reviews a pull request and what has to happen before it merges.

CODEOWNERS picks the reviewers

A CODEOWNERS file maps paths to the people or teams responsible for them. When a pull request changes files someone owns, GitHub requests their review automatically. Draft pull requests are skipped until they're marked ready for review.

# Default owners for everything in the repository
*          @acme/backend

# Later lines take precedence over earlier ones

# Default owners for everything in the repository
*          @acme/backend

# Later lines take precedence over earlier ones

# Default owners for everything in the repository
*          @acme/backend

# Later lines take precedence over earlier ones

Put the file in .github/, the repository root or docs/. GitHub searches those locations in that order and uses the first file it finds, and review requests use the copy on the pull request's base branch. Patterns follow most .gitignore rules, the last matching pattern wins, and every owner, teams included, needs write access to the repository. Our CODEOWNERS guide covers the file in more depth.

Branch protection and rulesets make reviews required

A branch protection rule or a ruleset on your main branch turns review from a habit into a merge requirement. Repository admins, or custom roles with the "edit repository rules" permission, can turn on these options:

Option

What it means for reviewers

Required approvals

Changes reach the branch only through a pull request approved by the set number of reviewers with write access

Code owner review

A pull request that touches owned code needs an approval from one of its code owners

Dismiss stale approvals

A push that changes the diff removes earlier approvals

Approval of the most recent push

Someone other than the last person to push must approve

Conversation resolution

Every comment thread must be resolved before the pull request can merge

No bypass for admins

The rules apply to admins too; by default, admins can bypass branch protection

With required reviews on, a Request changes review blocks the merge until that reviewer approves or someone with write access dismisses it. Combined with CODEOWNERS and the code owner review option, this means the owners of a piece of code are asked to review every change to it, and, unless an admin bypasses the rule, the pull request can't merge without an approval from one of them.

How to review a pull request with the gh CLI

The GitHub CLI handles the parts of a review that don't need line comments:

# Open pull requests waiting for your review
gh search prs --review-requested=@me --state=open

# Check out a pull request locally to run it
gh pr checkout 123

# List the changed files, or leave generated ones out of the diff
gh pr diff 123 --name-only
gh pr diff 123 --exclude 'generated/*'

# Submit a review
gh pr review 123 --approve
gh pr review 123 --request-changes -b "fetchUser retries forever on a 500. Cap it at three attempts."
gh pr review 123 --comment -b "Two questions on the cache key, otherwise this looks good."
# Open pull requests waiting for your review
gh search prs --review-requested=@me --state=open

# Check out a pull request locally to run it
gh pr checkout 123

# List the changed files, or leave generated ones out of the diff
gh pr diff 123 --name-only
gh pr diff 123 --exclude 'generated/*'

# Submit a review
gh pr review 123 --approve
gh pr review 123 --request-changes -b "fetchUser retries forever on a 500. Cap it at three attempts."
gh pr review 123 --comment -b "Two questions on the cache key, otherwise this looks good."
# Open pull requests waiting for your review
gh search prs --review-requested=@me --state=open

# Check out a pull request locally to run it
gh pr checkout 123

# List the changed files, or leave generated ones out of the diff
gh pr diff 123 --name-only
gh pr diff 123 --exclude 'generated/*'

# Submit a review
gh pr review 123 --approve
gh pr review 123 --request-changes -b "fetchUser retries forever on a 500. Cap it at three attempts."
gh pr review 123 --comment -b "Two questions on the cache key, otherwise this looks good."

gh pr review submits a decision with a summary. It has no option for line comments, so leave those on the web page or in your editor.

What to look for while you review

Read in roughly this order:

  1. Intent. Does the change do what the description and issue say, and should it exist?

  2. Correctness. Logic, edge cases, error handling, concurrency, and anything that breaks existing callers or data.

  3. Security. Authorization on every resource, input handling, secrets and new dependencies. For a manifest or lock file, click the rich diff button in its header to see GitHub's dependency review of what changed and any known vulnerabilities.

  4. Tests. Would they fail if the code were wrong?

  5. Design and readability. Does it fit how the codebase already works?

  6. Style. Last, and only what the linter misses. Mark it Nit:.

Our code review checklist turns each of these into specific checks and includes a Markdown template you can paste into your pull request template.

Two rules from Google's guide are worth borrowing: respond to a review request within one business day, and approve once a change definitely improves the overall code health of the system, even if it isn't perfect. For more on keeping reviews moving, see how to speed up PR reviews on GitHub.

How to review AI-written changes

A pull request written by a coding agent gets the same review as any other, with a few extra checks. Review keeps finding real bugs in this code. On cubic's Bug Bench, a counted bug is a cubic review finding on AI-written code that a developer upvoted or an AI coding agent addressed. The seven ranked models have relative bug rates from 0.65 to 1.50, where 1.00 is average and lower is better. Teams choose their models, so a rate reflects the code each model was used for as well as the model, but every ranked model has counted bugs.

The extra checks:

  • Read the description against the diff. A generated description can describe what the agent set out to do rather than what the code does.

  • Check the scope. Unrelated reformatting, renames and refactors hide the real change. Ask for them in a separate pull request.

  • Read the test diff early. Deleted assertions, skipped tests and loosened checks can turn CI green without fixing anything.

  • Verify new packages and APIs. Models can invent names. A study accepted at USENIX Security 2025 found that, on average, at least 5.2% of the packages commercial models referenced were hallucinated, and 21.7% for open-source models. Check each new dependency against its registry.

  • Run it. For anything beyond a small change, gh pr checkout the branch and run the tests and the feature yourself.

  • Ask the author to explain. Whoever opened the pull request owns it. If they can't explain a change, request changes.

If an agent in your setup acts on review comments, submit all your comments as one review so it sees the full picture at once.

An AI reviewer can take the first pass on agent-written pull requests and post its findings as review comments. GitHub's own option is Copilot code review, which needs a Copilot plan. To use it, click Request next to Copilot under Reviewers in the sidebar. By default it leaves a Comment review, which doesn't count toward required approvals. This blog is published by cubic, an AI code review tool that checks each pull request against your whole codebase and your team's rules.

Treat AI comments like any reviewer's, and keep a human approval on the pull request so a person still signs off on design and intent. AI pull request review on GitHub walks through setting one up, and our AI code review guide explains how teams split the work.

FAQ

Can you approve your own pull request on GitHub?

No. GitHub doesn't let pull request authors approve their own pull requests, and you also can't approve a pull request that Copilot opened if you were the one who assigned Copilot to its issue. You can still comment on your own pull request, and reading your own diff on the Files changed tab before you ask for review is a good habit.

How do I find pull requests waiting for my review?

Go to github.com/pulls/review-requested, or search with review-requested:USERNAME (or team-review-requested:TEAMNAME for a team). From a terminal, gh search prs --review-requested=@me --state=open lists the open ones.

How do I review a pull request in VS Code?

Install the GitHub Pull Requests and Issues extension and sign in. Select the pull request in the Pull Requests view, commit or stash your own changes, and select Checkout; the extension enters Review Mode and lists the changed files and commits. Select a file to see its diff and comment, submit your comments or review from the pull request's Description, then select Exit Review Mode to go back to your branch.

Does Request changes block merging?

Only when a ruleset or branch protection rule requires a pull request before merging. In that case, a Request changes review from someone with write, admin or owner access blocks the merge until that person approves or someone with write access dismisses the review. By default, repository owners and admins can still merge without an approving review.

Table of contents