Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download Github pull request as unified diff

How can I download the changes contained in a Github pull request as a unified diff?

like image 948
Thilo Avatar asked May 31 '11 13:05

Thilo


People also ask

How do I download a pull request patch from GitHub?

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.

How do I get a diff from GitHub?

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.

How do you compare pull requests?

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.

Can you give differences between pull request and branch?

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.)


1 Answers

To view a commit as a diff/patch file, just add .diff or .patch to the end of the URL, for example:

  • https://github.com/weppos/whois/pull/90
  • https://github.com/weppos/whois/pull/90.diff
  • https://github.com/weppos/whois/pull/90.patch
like image 199
Simone Carletti Avatar answered Sep 26 '22 03:09

Simone Carletti