views:

62

answers:

1

If the base and the source have the same file content, and the destination branch/repo has some other file changes, which content does it keep, the source or the destination file?

To explain in detail

       A 
       | 
       B 
      / \
     C   D 

Suppose that a file was added on the A->B edge, and then removed again in B->C, while it was left alone on the B->D edge.
We want to merge C and D.

If the common ancestor is A which doesn’t have the change (so A,C don’t have the file & B,D has the file) when merging C and D.

What happens if C (destination) merges from D?

What happens if D (destination) merges from C?

+3  A: 

Merge is symmetric (aside from the fact that the merge ends up on one branch or the other). It will apply changes from both sides and report any conflicting changes it encounters in the process. In this case, since only one side has changes, the end result will look identical to the side that has the changes.

As an aside, you can try these operations quite safely to see what they will do; if things go pear-shaped, just undo. Be sure to note the caveats at the bottom of the linked article, though.

Marcelo Cantos
Thanks :), but my bad i didn't verbalize my question as intended....have added more to my questions.
Senthil A Kumar
My answer still stands. See my comment to your amended question.
Marcelo Cantos