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.
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.
OK, found the answer myself.
Adding .patch
(or .diff
) to the commit-URL will give a nice patch:
https://github.com/foo/bar/commit/${SHA}.patch
Thanks to Ten Things You Didn't Know Git And GitHub Could Do...
I found I had to add a / at the end, i.e.
https://github.com/foo/bar/commit/${SHA}.patch/
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