Some time ago, the brilliant GitHub people gave me the following tip. Rajarshi is lazy, and might find it interesting. By appending .patch to the commit URL, a commit can easily be downloaded as patch. That way, developers can easily download it with wget or curl and apply it locally with git am, without having the fetch the full repository.
For example, Dmitry made this commit in his branch, having the URL https://github.com/dmak/cdk/commit/9b0478d50c7b5ca10f77fb01d89329db5fe80625. The patch for this commit can then be downloaded at this URL https://github.com/dmak/cdk/commit/9b0478d50c7b5ca10f77fb01d89329db5fe80625.patch.
Willighagen, E. (2011, January 30). GitHub Tip: download commits as patches. Chem-bla-ics. https://doi.org/10.59350/7dnxr-jv029

I just love this tip! Thanks for sharing, this is just what I was looking for.
ReplyDeleteGood to hear you like it too :)
ReplyDeleteGah, so obvious! ...but why isn't there a giant link to do this on the page itself?
ReplyDeleteThanks for the post!
Thank you very much for the tip :-)
ReplyDeletegithub should really place a "Download as.."-button there!
awesome tip.
ReplyDeleteyea, the code page itself has a "raw" button. I think the view for the commit page just hasn't hooked to .patch for that "raw" context. seems it would be an easy route to add.
Thanks for the tip. I've hunted for this for ages! It sucks that github think we don't really need it.
ReplyDeleteThanks for the tip. Didn't know that it existed before.
ReplyDeleteNot sure why github is not making it more prominent in the UI.
Geniously simple. It should be visible as a link on github, i was searching the interwebz for your post exactly for this
ReplyDelete