How to pull the changes in Branch1 to Branch2 within the same repo?

22 Views Asked by At

I am working on a Forked repo (xyz) of an Upstream repo (abc). I created a branch (Branch1) and started working on it. Once Done, I raised a PR which looks like this:

Open: amol wants to merge 5 commits into abc:main from amol:Branch1

Now, while the PR is in review, I created a new branch (Branch2) and started working on different task. My PR reviewers find some basic corrections and make those modifications to the PR accordingly. I fetched those changes from upstream to my Local Branch1. I now want those changes to be updated in my current Branch2 as well. What should I do?

I tried following commands on my local system using Git Bash.

git switch origin Main
git fetch upstream pull/#PR_ID/head:Branch1
git switch Branch1

By this I got those modifications done by the reviewers on my local system.

What should be the further commands to bring those modifications to my Branch 2?

0

There are 0 best solutions below