79194617

Date: 2024-11-16 06:32:41
Score: 0.5
Natty:
Report link

askielboe's answer worked well for me, when I was in a similar situation (2024-11-15), with two modifications:

  1. curl https://github.com/USER/REPOSITORY/pull/1.patch | git am did not work for me. So I visited https://github.com/USER/REPOSITORY/pull/1.patch and found I was redirected to https://patch-diff.githubusercontent.com/raw/USER/REPOSITORY/pull/1.patch, for whatever reason. curl https://patch-diff.githubusercontent.com/raw/USER/REPOSITORY/pull/1.patch | git am did work for me. Who knows why, ha ha.
  2. I didn't do any branching business. Just that one command is fine: it downloads the patch as a mail file (like an email), and applies it as a patch using git am (apply mail); this creates a new commit(s) on top of whatever commit you're currently on, as you'd expect.

As the other answers and comments have said, you can also probably git fetch origin pull/ID/head:BRANCH_NAME à la https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally, if that's more useful to you somehow.

Reasons:
  • Blacklisted phrase (1): did not work
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Wyatt Carpenter