This guide lists key the considerations for evaluating a GitHub Pull Request (PR), and describes how to work in a GitHub PR to evaluate proposed file changes.

Topics in this guide

Key considerations for evaluating a GitHub PR

This topic describes key considerations for evaluating a GitHub PR.

A GitHub PR contains file changes proposed by another contributor. Typically, when a contributor creates a GitHub PR, they also nominate a reviewer on GitHub. The GitHub reviewer must then evaluate the contributor’s proposed changes, within the PR, to determine their acceptability.

The following list of key considerations can help GitHub reviewers evaluate a GitHub PR.

  • On GitHub, changes made to files on one branch can be compared and contrasted with (unchanged) files on the originating branch using the Differences (or diff) feature.
  • The diff feature on GitHub shows how the contents of a file were modified, line-by-line. Within a “diffed” file, red colored line items indicate deletions, and green colored line items indicate additions.
  • There’s no way to select and merge individual changes from a GitHub PR. All or none of the changes must be accepted and merged, or rejected.
  • Comments can be added to a PR to facilitate a discussion of the changes proposed within a GitHub PR between the person proposing the changes, the GitHub reviewer, and any other contributor added to the PR. For example, between an Author, a Content Editor, and a GitHub reviewer.
  • GitHub reviewers can use comments to provide the PR owner with feedback on their proposed changes. The PR owner can work on their originating branch to apply the reviewer’s suggestions to the files in the open PR. When the reviewer and PR owner are satisfied with the corrections/ edits, the contents of the PR can be merged.
  • Alternatively, a GitHub reviewer can apply their corrections/ edits to a new branch, and then open a new PR to merge the files that contain the reviewer’s edits.

Note: The PR evaluation and review processes can vary between projects. Ask your project manager about the PR evaluation and review processes that apply to the project you’re working on.

Evaluate a PR on GitHub

Complete the following steps to evaluate a PR on GitHub.

  1. In a web browser, sign into GitHub, and go to the project’s GitHub repository (remote repo).

    For example, in the following image, the WayPoint Ventures’ test repository (Testrepo1) is open on GitHub.

    Example GitHub repo in a web browser

  2. Choose the Pull requests tab, and then select the GitHub PR you require from the list of open PRs.

    GitHub 'pull requests' tab

    Note: To view details about a PR that was closed previously, choose the closed icon from the Pull requests page, and then select the GitHub PR you require from the list of closed PRs.

  3. Choose the Files changed tab.

    GitHub 'Files changed' tab

    Note: The Files changed tab shows a list of all the files within the PR that were added or changed by another contributor.

  4. Select the expand arrow icon, on the left side (beside a filename), to expand or collapse the contents of a file in the PR.

    GitHub 'pull requests' tab with expand/ collapse arrows

    Inside the file, items that have been replaced or deleted are colored in red. Items that have been added are colored in green.

    File contents in the GitHub editor

  5. Optional: Add a comment to query a proposed change or specific area of a modified file.

    To add a comment about a proposed change, hover your cursor over part of the file, then select the blue box with the white plus sign. Type your comment, and choose Start a review. You can preview your comment from the Preview tab.

    The 'add comment' field within the 'files changed' tab of a GitHub pull request

    Note: Use the Start a review feature to create a new GitHub PR review. A GitHub PR review is visible to the person proposing the changes, the owner of the originating branch, and any other contributor assigned to the PR. Use the GitHub PR review and commenting feature to initiate a discussion among stakeholders about proposed file changes on GitHub. If deeper discussion is necessary, supplement your GitHub review comments with email communication.

    Stakeholders can exchange comments in the Review comment area by typing into the reply box.

    The 'reply to comment' text entry field within the files changed tab of a GitHub pull request

    After you’ve typed your GitHub PR review comment, select Add review comment.

    The 'add review comment' button for submitting comments associated with a GitHub pull request

    Note: You can edit a GitHub PR review comment after it’s been posted.

  6. To apply a proposed change, open a file for editing by selecting the ellipsis icon on the right side of the file (three dots ...), and select Edit file.

    The 'edit file' button for launching the GitHub editor

  7. Apply changes to the file by typing directly into the GitHub editor panel.

    The GitHub editor allows you to scroll through a file’s contents, make edits, and preview changes in your browser.

    GitHub editor with a file open for editing

  8. When you’ve applied your changes, scroll to the end of the GitHub editor panel. Enter a short title and description for your changes. Ensure that the option to commit directly to the reviewer branch is selected, and choose Commit changes.

    GitHub editor 'commit changes' button

    The change you made is visible inside the GitHub editor panel. Your commit will be added to the GitHub PR that’s open on the current branch.

    GitHub editor with changes made to an opened file

    Note: Alternatively, you can choose to commit your edits to a new branch, and then open a new PR to request merging your edits into the originating branch.

  9. When you’ve evaluated and applied your changes to a file, set the file’s status to Viewed using the checkbox, as shown in the following image.

    File status checkbox set to 'viewed' on GitHub

    Note: Setting a file’s status to Viewed indicates that the file has been evaluated, and can proceed to the next stage in the process. Updating a file’s status allows other contributors to track the progress of a review from the corresponding GitHub PR page.

  10. Select the Display the rich diff icon to enable the rich diff feature in GitHub.

    GitHub’s rich diff (rich differences) feature provides a preview of the file changes that a PR contains, like the Track Changes option in Microsoft Word.

    Output of GitHub's 'rich diff' for previewing the file changes

    To return to the default diff view, select the Display the source diff icon again.

    The 'Display the source diff' button on GitHub

  11. Other contributors to the PR can evaluate file changes, and add comments.

    Contributors can add and submit comments and emoji’s (optional) from the Conversation tab, to discuss proposed changes.

    The 'Conversation' tab within a GitHub PR

  12. Work through the GitHub PR until you have reviewed and implemented all the necessary file changes.

  13. Merge the finished files into the base branch (like master) by following the guide Merge a pull request.

You have evaluated a PR on GitHub successfully.

Appendices

Check the following supplementary Appendices for more details and context.