0

I can see how to clone a pull request, but the answers rely on there being a specific branch made for the PR.

How do we clone a PR for which no branch was explicitly created; that is, a pull request that was created via the following workflow:

  1. Fork original
  2. Make changes, commit
  3. Make pull request to original

(no explicit branching)

stevec
  • 41,291
  • 27
  • 223
  • 311
  • See https://stackoverflow.com/a/28622034/1256452 (answer within the question you linked). Read the accepted answer, sure, but then read on! :-) (https://stackoverflow.com/a/14969986/1256452 has the same thing, more or less, plus an alias.) – torek Feb 02 '20 at 00:51
  • @torek thanks really appreciate it. I think I understand it. Is `NEW_LOCAL_BRANCH` made up on the spot ie at the time of the clone? Eg `pull_611` in the linked example – stevec Feb 02 '20 at 01:29
  • Yes, `git fetch` will create it. (If you use an existing branch name, `git fetch` has rules it follows about updating branches, but generally you want to use a name based on the PR # so that the name is unique and the question never arises :) ) – torek Feb 02 '20 at 01:50

1 Answers1

0

Based on @torek's advice, simply

git fetch origin pull/4/head

where the 4 came from

enter image description here

stevec
  • 41,291
  • 27
  • 223
  • 311