Reviewing proposed changes in a pull request

In a pull request, you can review and discuss commits, changed files, and the differences (or "diff") between the files in the base and compare branches.

In this article

About reviewing pull requests

You can review changes in a pull request one file at a time. While reviewing the files in a pull request, you can leave individual comments on specific changes. After you finish reviewing each file, you can mark the file as viewed. This collapses the file, helping you identify the files you still need to review. A progress bar in the pull request header shows the number of files you've viewed. After reviewing as many files as you want, you can approve the pull request or request additional changes by submitting your review with a summary comment.

Tip: You can find a pull request where you or a team you're a member of is requested for review with the search qualifier review-requested:[USERNAME] or team-review-requested:[TEAMNAME]. For more information, see "Searching issues and pull requests."

Starting a review

  1. Under your repository name, click Pull requests.

    Issues and pull requests tab selection

  2. In the list of pull requests, click the pull request you'd like to review.

  3. On the pull request, click Files changed.

    Files Changed tab

  4. Hover over the line of code where you'd like to add a comment, and click the blue comment icon.

    Blue comment icon

  5. In the comment field, type your comment.

    Comment field

  6. Optionally, to suggest a specific change to the line, click , then edit the text within the suggestion block.

    Suggestion block

  7. When you're done, click Start a review. If you have already started a review, you can click Add review comment.

    Start a review button

Before you submit your review, your line comments are pending and only visible to you. You can edit pending comments anytime before you submit your review. To cancel a pending review, including all of its pending comments, scroll down to the end of the timeline on the Conversation tab, then click Cancel review.

Cancel review button

Marking a file as viewed

After you finish reviewing a file, you can mark the file as viewed, and the file will collapse. If the file changes after you view the file, it will be unmarked as viewed.

  1. On the pull request, click Files changed.

    Files Changed tab

  2. On the right of the header of the file you've finished reviewing, select Viewed.

    Viewed checkbox

Submitting your review

After you've finished reviewing all the files you want in the pull request, submit your review.

  1. On the pull request, click Files changed.

    Files Changed tab

  2. Above the changed code, click Review changes.

    Review changes button

  3. Type a comment summarizing your feedback on the proposed changes.

    Review summary comment window

  4. Select the type of review you'd like to leave:

    Radio buttons with review options

    • Select Comment to leave general feedback without explicitly approving the changes or requesting additional changes.
    • Select Approve to submit your feedback and approve merging the changes proposed in the pull request.
    • Select Request changes to submit feedback that must be addressed before the pull request can be merged.
  5. Click Submit review.

Tips:

  • If required reviews are enabled and a collaborator with write, admin, or owner access to the repository submits a review requesting changes, the pull request cannot be merged until the same collaborator submits another review approving the changes in the pull request.
  • Repository owners and administrators can merge a pull request even if it hasn't received an approving review, or if a reviewer who requested changes has left the organization or is unavailable.
  • If both required reviews and stale review dismissal are enabled and a code-modifying commit is pushed to the branch of an approved pull request, the approval is dismissed. The pull request must be reviewed and approved again before it can be merged.
  • When several open pull requests each have a head branch pointing to the same commit, you won’t be able to merge them if one or both have a pending or rejected review.

Further reading

Ask a human

Can't find what you're looking for?

Contact us