I use a lot of GitHub - in my view it’s the premier Git hosting solution out there and keeps getting better and better. Every now and again I stumble across a useful little trick or technique that I don’t know about. This one is a means to output commits on GitHub as unified diff files. I’ve blogged it because I can’t find it anywhere in the GitHub documentation. The trick is very easy - simply add .patch to the end of any commit URL to output the commit as a unified diff patch file. For example, this commit becomes a diff. Simple. Enjoy.
Output GitHub commits as unified diffs
Append .patch to any GitHub commit URL to get the change back as a unified diff patch file2009-09-19T00:00:00.000Z1 min readgit, github, diff, patch, commit
Append .patch to any GitHub commit URL to get the change back as a unified diff patch file
1 min read
# written 17 years ago; commands, versions and links may have changed
$ whoami
I'm James Turnbull. I lead engineering teams, build products, and write on technology. More about me.