When someone picked a cherry from my git, commits and commits their own actions, how do I merge?

Suppose I tried someone git repo and committed commits A, B, C and D. Perk, which I forked, then cherries selects A and C, so they become A 'and C'. It also commits X, Y, and Z. So after all this, my branch has ABCD and it has A 'C' XY Z. Suppose both branches are published, so rebase is not an attractive option. Also suppose XYZ does not conflict with any of the ABC D. How can I merge these two branches in a useful way? Should I just merge and then manually resolve everything? Is there anything I can do to duplicate commit messages in the log of a merged chapter? From now on, do these two branches, doomed to synchronization only by collecting cherries, commit?

+3
source share
2 answers

Direct merging should work. Git should notice identical change sets and will not try to merge A / A 'or C / C'. If X, Y, or Z touched the same code as A '/ C', you might have to resolve conflicts there, especially if B or D touched the same code.

You can always git merge --no-commitcheck the result to find out what you expected.

+3
source

In the absence of conflict, a direct merger is obvious. If there are conflicts, though ...

C ', - , , . , C B C ' , - B C D A, A' no-op ..

:

git merge --strategy=ours C'

, . X Y Z A B C D, . - C C ', C', , .

+1

Source: https://habr.com/ru/post/1780770/


All Articles