0

I have two main separate branch Master and release. My two PR(pull request) merged to Master branch called. featureA and featureB and deleted. Also many other feature branch merged to Master by different people.

Now, I want to create new PR/branch based on release branch called releaseAB, which should have commit from featureA and featureB as a single commit.

I tried.

git checkout release
git checkout -b releaseAB
git reflog **(Which doesn't show hash of `featureA` and `featureB` as it's on Develop branch)**
git cherry-pick <not sure which should I cherry pick)

I am not good in git So, not sure what should I do?

Any help would be greatly appreciated.

ketan
  • 19,129
  • 42
  • 60
  • 98
  • The branches may have been deleted but the PR keeps the commits alive. So you can fetch the PR and its commits and cherry pick the ones you want, and squash them. – matt Sep 14 '21 at 10:53
  • @matt Which cherry-pick hash I should use? I can not find any hash in reflog – ketan Sep 14 '21 at 10:56
  • I mean I cannot find hash related to featureA and featureB commit – ketan Sep 14 '21 at 10:57
  • No, it's not in your reflog. It's on the server. That's why I said fetch. – matt Sep 14 '21 at 11:14
  • I checkout to Master and did `git fetch` but, not showing hash. – ketan Sep 14 '21 at 11:41
  • https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally – matt Sep 14 '21 at 11:47
  • Ahh got it. But, it does not stash changes locally. `git fetch origin pull/ID/head:BRANCHNAME` and what should I do if need changed from multiple PR? – ketan Sep 14 '21 at 14:22
  • As I said, treat that as a temporary branch, cherry pick any desired commits onto your real branch, and now manipulate the commits as desired. – matt Sep 14 '21 at 14:26

0 Answers0