github

Way to compare range of commits in pull request on Github?


Scenario, first 5 commits in a PR have already been code reviewed. Made a few more commits and want to focus in on those.

How can I compare a range of commits in the pull request on Github?


Solution

  • The most convenient way I found is:

    1. Open PR conversation
    2. Find the last commit that have already been reviewed and click its hash link, your URL will look like https://github.com/airbnb/javascript/pull/188/commits/2b6c524e6984f300f6c6e08e57c8dbab9497e798
    3. Change commits to files and add ..HEAD to the end of URL such as https://github.com/airbnb/javascript/pull/188/files/2b6c524e6984f300f6c6e08e57c8dbab9497e798..HEAD

    You'll see commits range you want to review in context of the PR.

    P.S. Now GitHub provides functionality to view "Changes since your previous code review" but sometimes it is useful to select changes manually