I'm able to see this PR with the commit of "c12b34" (made few days ago) using the following cmd
git ls-remote upstream
c12b34afadc4df762eaa482984170974c6f6b1c0 refs/pull/35/head
I then checkout the PR. But log does not contain the above commit; it only shows commits up to few months back.
git checkout -b upstream/35
What am I missing? Thank you.
When you use git checkout -b
, you create a local name—a branch name—based on some commit that you already have. You probably do not have the commit(s) you need. You will need to run git fetch
to obtain those commits.
Those commits, however, are found by consulting a name in a name-space that your Git would ordinarily not bring over. You will need to run, e.g.:
git fetch upstream refs/pull/35/head:refs/heads/pr/35
to (a) obtain the commit(s) and then (b) create a local branch named pr/35
, for instance. No separate git checkout -b
is required at this point as the fetch
operation created refs/heads/pr/35
, which is a branch named pr/35
in your repository.
(Remember to delete your name pr/35
when done with it.)