Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update github branch from another branch

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.

like image 926
Waqar Ahmed Avatar asked May 22 '26 14:05

Waqar Ahmed


1 Answers

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 the branch1

like image 85
VonC Avatar answered May 24 '26 13:05

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!