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?
You can also compare two arbitrary commits in your repository or its forks on GitHub in a two-dot diff comparison. To quickly compare two commits or Git Object IDs (OIDs) directly with each other in a two-dot diff comparison on GitHub, edit the URL of your repository's "Comparing changes" page.
Submitting pull request on GitHubNavigate to the original GitHub repository, and you should see a big green button marked "Compare and pull request". Click that button and you will be taken to a page giving you the opportunity to describe your pull request and showing you the changes you have made.
You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch. Order does matter when you're comparing branches.
On the Github, go to the Source view of your project. You will see a link named 'Branch List'. Once the page opens you can see a list of all the remote branches. Hit on the Compare button in front of any of the available branches to see the difference between two branches.
The most convenient way I found is:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With