This article mentioned the following:
We merged the two snapshots pointed to by each branch and their common ancestors in three directions.
What I'm not sure about here is why we need a "common ancestor" to merge.
I thought it would be enough to merge the last commits of the two branches, but where do I need a common ancestor?It's amazing.
For example, suppose you changed the file hoge.txt to two branches, respectively:
hoge.txt
on branchAA
hoge
B
C
hoge.txt
in branchBA
B
piyo
C
Try merging these two.Can you do it?
Which of the following merge results should I choose?
hoge
and piyo
which were not originally presenthoge
and piyo
respectively" is correct not to include eitherB
that was added in both B
was not even thereTo determine this, you need the information How did each change to a common ancestor
?
© 2024 OneMinuteCode. All rights reserved.