What if there's a merge conflict with two files. Only person A is familiar with file A and only person B is familiar with file B
I'm new to git. So would it be possible for person A to resolve the conflicts in file A and then hand it over to person B to handle conflicts with file B?
Or does the unsolved conflict make it impossible to do git push?
CodePudding user response:
As far as I know it is not possible to hand over a conflict to another person. And in order to push you've to solve the conflicts first.
However if Person A doesn't know anything about file A, Person A shouldn't edit file A which then wouldn't cause a merge conflict?
CodePudding user response:
As Kevin answered, you cannot hand the partially-resolved merge conflict to someone else other than by sharing a working tree. You can only push commits (not files), and commits are by definition resolved.
What you can do—this requires a lot of manual cooperation and hand work—is resolve your conflicts "correctly", resolve the remaining conflicts "incorrectly" but mark them as such, add and commit the result, and deliver the resulting commit to the next person. That person can start their own merge, take your (presumably marked in some manner) correct resolutions (from your separate commit, presumably on a separate branch) and put them in their partial merge, and work on the remaining conflicts. They can repeat this process as needed.
Git needs a mechanism by which this can be automated, but does not have one.
CodePudding user response:
It's not really very hard to do, you just have to know who's responsible for resolving which conflicts.
Say you've got master and fixups branches, and a merge produces conflicts in fileA and fileB that you don't want to resolve, so you get Alice and Bob to do partial merges, Alice fixing the fileA and Bob fixing the fileB conflicts, with fake resolutions for the files you don't need from them. They push their results back to you as partial-merge-from-Alice and partial-merge-from-Bob
Now you do the merge, it produces those conflicts, and you say git checkout partial-merge-from-Alice filea and git checkout partial-merge-from-Bob fileB.
You're done. Commit the result and everybody goes home.
If it's more complicated, add --patch to your checkouts from the partial merges, and pick and choose which resolutions you want.
