Reviewing through GitHub Pull Requests

contributing
reviewing
workflow
Instructions on how to review changes through Pull Requests on GitHub.
Published

December 29, 2022

The Git collaborative workflow revolves around creating branches, making edits and changes on those branches, and submitting pull requests of those branches to be merged into the main branch. A key part of this workflow is the review part, where someone will look over the changes made and if necessary request new changes or fixes before the pull request can be merged.

So how do you do a review of a pull request. Thankfully GitHub has a pretty decent set of instructions on how to do them.

Briefly, the steps you take to review a pull request is:

  1. Open the pull request.
  2. Go to the “Files changed” tab. This tab shows what text has been added (in green) or removed (in red).
  3. Review the removed and added changes. If you have comments to give, hover with the cursor on the line you want to comment on. There will be a blue plus button that pops up on the left of the line number.
  4. To add a comment, click the blue button and a text box will pop up. Write your comment there. Almost always, you will want to click the “Start a review” green button.
  5. When you are, scroll to the top and click the green “Review changes” button. You can optionally write a general comment in the text box, otherwise, select one of the options: “Approve”, “Request changes”, or “Comment”. Then click the “Submit review”.
  6. You have now finished the review!

For a short 4 minute demonstration, check out the YouTube below on doing a pull request review.

There’s also a much longer presentation (40 minutes) by GitHub talking about some of the reasons and concepts behind pull requests, code reviews, and working with the “GitHub Flow” workflow (making branches, submitting pull requests, getting reviewed, and merging). This is more for learning to have a better understanding of what and why the “GitHub Flow” is useful for collaboration.