Hi Matevz,

On Thursday, May 18, 2017 at 12:22:09 AM UTC+2, matevz...@borea.si wrote:
>
> thanks for your help, I would give up otherwise, but now I managed to get 
> this working with a special git merge script that automatically performs 
> merge from A to B and vice versa by ignoring (with git merge -s ours) all 
> opposite commits created by automated merge script (by itself), 
>

Would you mind sharing the script, please? I`m curious to see what works 
for you, still struggling to comprehend what benefits merging provides in 
your use-case.
 

> Also with "git merge -s ours" we can select which parts of the history we 
> want to carry forward and which parts not. After performing single merge 
> with -s ours for certain part of the history git will no longer complain 
> about that in future merges (even normal merges) as it has already marked 
> it as merged.
>

This is true, but this "fake merge" is usually used for single way merging 
only, where you`re disregarding part of the history of the branch you`re 
merging from (say, A), kind of declaring it obsolete/superseded by the 
branch you`re merging into (say, B), but keeping the reference to it. Then 
you can keep merging in the same direction (from A to B), having only new A 
commits being included in the the future merge(s) to B.

But as soon as you try to merge the other way around, hoping to merge only 
new commits from B to A, you may be surprised by the outcome, having 
changes contained in your "private" B commits coming along, too, with 
"private" A commit changes now actually being removed inside the very A 
branch - a behavior you already experienced in your simple test repository.

If you instead do another `git merge -s ours` but in a different direction 
first (from B to A), then merging the new commits found on B to A, this 
will work, but it kind of seems as a glorified cherry-picking...? Not sure 
if any advantages you`re looking for in merging, if any in this case, are 
worth the badly messed up history with these repetitive `-s ours` cross 
merges :/

Hey, but if it works for you, I guess all is good :) I`m just curious.

Regards,
Buga

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to