0

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.

Werner Henze
  • 15,279
  • 12
  • 41
  • 62
akshay_shahane
  • 3,273
  • 1
  • 13
  • 29

2 Answers2

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
  • 400
  • 1
  • 7
  • 2
    This will only cherry-pick *one* commit. What if changes in `A` consist of several commits? `git cherry-pick B..A` would cover that. – RomainValeri 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
  • 544
  • 2
  • 15