When I try to merge stage into master I get these weirdly nested conflict lines. As I try to pick the one I want to keep in vimdiff mergetool with :diffg LO and :diffg RE it does seemingly weird changes and I can never get to a proper merge resolution.
The screenshots are from Notepad++ compare plugin. Local file on left, Remote one on right.
Conflict 1:
- The lines I actually want to keep are just the two divs on the left side which aren't marked as different between the files by Notepad++
- http://puu.sh/ntjfu/ffe8d95ed4.png
Conflict 2:
- I don't know what this is. Random spaces I guess. There is no actual code conflict, just need to get rid of all that mess
- http://puu.sh/ntjvw/24902c439f.png
My guess is that the merge marks are causing conflicts with other merge marks, putting merge marks around them. When, say, a remote change is chosen, the next merge marks that were actually the conflict now are interpreted as actual merge marks, but it doesn't pick up the right opening or closing lines of the merge mark due to how they are nested.
I've tried simply deleting all the merge stuff (the merge marks and their presented lines, .orig.orig and _LO and _RE files that appeared) and leave the files (the real file and .orig file) the way I want them, but that didn't work for me.
Can you please explain how these kind of conflicts work, how should I see them and what are the options for dealing with them?
Also, to understand merging better, I'd like to know how Git finds those marks. From what I tried, I'm thinking it will look for them based on a record of their location and run into problems if they have been deleted entirely from where they should be?