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


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


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.