A little experiment about cherry-pick

background

Curiosity:
The current code is in commit c1, pull out branches a and b, switch to branch a, add a new line of information, commit, get c2, and then modify the line of information added in the previous step to get c3.

At this time, the a branch is in c3, and the b branch is in c1. What happens when git cherry-pick c3 is executed in the b branch?

Explanation : The purpose of doing this experiment is actually to see what will happen, because the modification of c3 is based on the newly added line of c2, so can the modification of c2 be introduced directly only by cherry-pick p3?

result

The result of the practice is that there is a conflict, and the result of c2 is also brought out

<<<<<<< HEAD
第一行信息,是initial的时候的222
=======
第一行信息,是initial的时候的222



a分支里增加这一行|在第二行的基础上增加这个
>>>>>>> e3ba8be... 在a分支新增的第二行中进行修改

Among them, c2 is added a分支里增加这一行, and c3 is added on the same line |在第二行的基础上增加这个(equivalent to modifying this line)

It can be seen that the conclusion is that there is a conflict, and the basis c2 of c3 is also brought out

Guess you like

Origin blog.csdn.net/w8y56f/article/details/132116865