gitgit-merge

What does merge xx into xxx mean


In my repo, I have one branch (branch_1) and from it, I have been committing some changes. Then I created a new branch from branch_1, branch_2.

Master---
         \
          Branch_1--commit1--commit2
                                   \
                                    Branch_2 (current branch) 

Meanwhile, a review was done in Branch_1 and I made some changes:

  Master---
             \
             Branch1--squashed commit1,commit2--commit3--commit4
                                       \
                                        Branch2 (current branch)

How can I now apply the last changes of branch_1 in branch_2? What it means to merge branch_1 onto branch_2 and vice versa.


Solution

  • Technically speaking, what you're asking for is a rebase (which is laymens terms means moving the point where you branch off around on the trunk), a merge is a superset of it.

    However, merging Branch1 into the current branch (Branch2) will do what you want.

    What it means to merge branch_1 onto branch_2 and vice versa.

    It means bringing in all the changes from one branch into another. The order is important, it is what determines what branch you're writing into.