How can I download the changes contained in a Github pull request as a unified diff?
Every pull-request on GH can be downloaded as a beautiful mail-patch, just by appending ". patch" to the pr URL. This will generate a mail-formatted patch file, that is a little different from an usual patch file: It has e-mail metadata.
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.
Navigate 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.
A branch is just a separate version of the code. A pull request is when someone take the repo, makes their own branch, does some changes, then tries to merge that branch in (put their changes in the other person's code repository). (In the most general of terms.)
To view a commit as a diff/patch file, just add .diff
or .patch
to the end of the URL, for example:
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