I have checked out a PR using:
git fetch origin pull/pull_req_ID/head:NEWBRANCHNAME
However, I can't pull changes to my local branch from that PR.
If I understand the question correctly, another developer has pushed changes to a PR after you initially fetched it, and you want to get the latest updates. This should work:
git checkout NEWBRANCHNAME
git fetch origin pull/pull_req_ID/head
git rebase FETCH_HEAD # Or git merge FETCH_HEAD
Bitbucket example:
git fetch origin pull-requests/101/from:pr/101
git checkout pr/101
# ...New changes pushed to PR #101 by another developer
git fetch origin pull-requests/101/from
git rebase FETCH_HEAD
Gitlab example:
git fetch origin merge-requests/101/head:mr/101
git checkout mr/101
# ...New changes pushed to MR #101 by another developer
git fetch origin merge-requests/101/head
git rebase FETCH_HEAD
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With