14

I often find myself wanting a commit from a GitHub repository as a patch file. Is there any way I can do this through GitHub's web UI and get an output like git-format-patch? I'd like to be able to do this without cloning the repository, like how GitLab has Options -> Email Patches when viewing a commit.

1 Answer 1

13

Add .patch (or .diff) at the end of the commit URL:

https://github.com/torvalds/linux/commit/1ffaddd029c867d134a1dde39f540dcc8c52e274.patch

See also: https://stackoverflow.com/a/21903890

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.