On Wednesday, January 25, 2017 at 11:17:11 PM UTC+1, Stephen Morton wrote:
>
> I'm looking for a git branching and merge strategy for merge with lots of 
> conflicts requiring multiple people. I can make it work, and I understand 
> git, but it all seems kind of awkward and it feels like there must be a 
> better way.
>
> I've got a big git merge to do. There are lots of conflicts and it 
> requires many people to resolve them all.
>
> The only way to handle this in git, AFAIK, is to start the merge and then 
> just commit all files with conflicts in them and then let different people 
> work on the different conflicts, committing them as they go. That is great 
> for resolving the conflicts. In the diagram below, branchA is merged into 
> branchB with merge commit M. The code in the repo at M is full of 
> conflicts. Many of the conflicts in the merge are actually resolved in 
> commits x, y, z.
>
> o---o---o---o---- branchA
>  \       \
>   \-o---o-M---x---y---z branchB
>
>
> But I worry that the above strategy is not good for git's merge tracking 
> and future merges. Because if we do a 'git checkout branchA; git merge 
> branchB`, git will erroneously try to merge x,y,z into branchA.
>
> I *could *create branchB2 where I re-do the original merge but then just `git 
> checkout z -- . ` and commit that as the merge commit. That would work 
> well for the git merge tracking. Then I would keep branchB just as 
> historical reference for "who fixed what conflict and why" during the merge.
>
>
> The above would all work, but it seems so un-git-like. It feels like there 
> must be a much better and established practice, yet I have not found 
> anything online. Is there a better way to do this?
>
> Thanks,
> Steve
>
> p.s. I'm aware of answers like "Your workflow is broken, with git you 
> merge often and therefore never have lots of conflicts." It's just too long 
> a discussion to argue that point, so let's just avoid it, ok.
>

I`m sorry, but what I`m missing here is what you are actually trying to 
accomplish...?

I mean, you provided the graph, and you say you`re worried that if you do 'git 
checkout branchA; git merge branchB', commits x, y and z would 
"erroneously" end up in branchA, which should mean it is something you 
don`t want to happen.

BUT, then you say that you _could_ redo the merge, do 'git checkout z -- .' and 
commit that as resolved merge commit, and you would be happy with it (once 
you later merge branchB into branchA to introduce some new changes from 
branchB into branch A), keeping old (and unmerged) branchB for reference 
(commits x, y, z).

Now, I`m still pretty new to git, so please excuse me if I`m missing 
something, but how would that be different than just simply doing 'git 
checkout branchA; git merge branchB' in the first place (with the graph 
you`ve shown) - which you said you want to avoid...?

It seems the only difference would be keeping all x, y, z commits still in 
there (branchA history), which you first said you don`t want, but then 
later showed that you do actually seem to care about (in terms of changes 
they introduce), as you would be fine with committing them all at once as 
part of the (resolved) merge commit...?

I`m sorry if I`m failing to grasp something obvious here, I`m just a bit 
confused - you don`t want the commits (initial 'git merge branchB' concern), 
but you do want the changes (redo merge, checkout z, resolve commit)... but 
you also would like to have the history. But, (1) commits x, y and z _are_ 
history, and (2) either way, you end up with with branchA state being the 
same (whichever of the two paths you take).

So, what is that you would actually like to do (and I`m missing to get 
here)...? :)

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