I am taking the following example to ask a merge conflict question that I encountered at work.
Suppose I have a file named mainFile.txt in the master branch, and its content is:
1 this is the first line in master branch 2 this is the second line in master branch 3 this is the third line in master branch From the master branch, I created two branches: branchA and branchB, each has new lines (from line 4 in both branches) added to the same mainFile.txt file:
The content of the mainFile.txt in branchA:
1 this is the first line in master branch 2 this is the second line in master branch 3 this is the third line in master branch 4 This is the fourth line in branchA 5 this is the fifth line in branchA The content of the mainFile.txt in branchB:
1 this is the first line in master branch 2 this is the second line in master branch 3 this is the third line in master branch 4 This is the fourth line in branchB 5 This is the fifth line in branchB 6 This is the sixth line in branchB Now, I need to merge both branches back to master. There is no problem when I merge branchA first to master. However, merge conflicts show up when I merge the branchB to master. From the following attached screenshot for the merge conflicts, I need to keep all the lines from both branchA and branchB. I was wondering how I should resolve the merge conflicts. I have been trying to use vimdiff, but it seems to me that I need to make a decision of keeping either branch (not both).
