I have created a branch from another branch. Then I come back to previous branch and work on it. Now I have switched to second branch. But this second branch don't have the new changes of first branch. I just want to update the second branch from first branch without deleting any of them.
Asked
Active
Viewed 691 times
1 Answers
1
But this second branch don't have the new changes of first branch
Switching to the second branch alone is not enough for said branch to reflect changes committed in the first branch.
You would need to git merge branch1
or, if you are the only one working on branch2
: git rebase branch1
(if you want to keep a linear history).
Then, and only then, would you see branch1
changes in branch2
.
⇒ The OP Waqar Ahmed proposes in the comments:
I have solved this issue but checking out
branch2
and pull thebranch1

VonC
- 1,262,500
- 529
- 4,410
- 5,250
-
I have solved this issue but checking out branch2 and pull the branch1 – Waqar Ahmed Mar 01 '22 at 11:20
-
@WaqarAhmed Well done. I have included your comment in the answer for more visibility. – VonC Mar 01 '22 at 13:27