TIL: You can get a patch of PR

Published February 02, 2026

About a week or so I merged a PR a bit prematurely and we had to revert it. Not a big deal. Happens all the time. Somehow, when I went to recreate that PR today, I borked it. Got it in a state where GitHub was showing no differences between my branch and the main branch so I couldn't make a new PR. I did some searching online and I found out that you can easily get an appliable patch from any PR by going to the URL for the PR and adding .patch to the end of it. Once you have the patch, go to (or create) the branch you want to apply it to, create a local patch file (either download the patch or copy/paste it into a new file) and run git apply <patch filename>. All the changes from the PR are now in your local branch.


Previous: You don't need to have the links inline in Markdown