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