I have checked out branch B from A. And I have made some fixes in branch A. Afterwards I am going merge B into A. but right now I want changes from branch A to branch B which are made after checkout.
Asked
Active
Viewed 50 times
0
-
rebasing should cover what you need to do: https://stackoverflow.com/questions/14893399/rebase-feature-branch-onto-another-feature-branch – Mohamed Ali JAMAOUI Jul 08 '19 at 07:18
-
What does "checked out branch B from A" mean? You created branch B on top of branch A and then checked that out? – Werner Henze Jul 08 '19 at 07:19
-
`git rebase` B on top of the latest A should work. – Werner Henze Jul 08 '19 at 07:20
-
Merging a into b should also work. – evolutionxbox Jul 08 '19 at 07:23
-
@WernerHenze yes – akshay_shahane Jul 08 '19 at 07:24
2 Answers
0
You can use the concept of cherry picking use git log to check all new commits in A apply all commits one by one to branch B
git cherry pick A11 // assume A1 is the commits , do this in branch B
Make sure your sequence is right i.e oldest to newest from all new commits

Rahul Rana
- 455
- 2
- 7
-
2This will only cherry-pick *one* commit. What if changes in `A` consist of several commits? `git cherry-pick B..A` would cover that. – Romain Valeri Jul 08 '19 at 07:27
0
You can do this in many ways.You can use git merge or git rebase. Assuming you are in branch A right now
Using merge:
git checkout B
git merge A // (there won't be any conflicts now)
Or you can do this simply by git rebase:
git rebase A B // (there won't be any conflicts now)

naib khan
- 928
- 9
- 16