Reputation: 1
I'm having issues with git mergetool on vscode. I'm on a feature/ branch and trying to merge in updates from develop. (This is a react native project, and I'm trying to merge develop branch that changed codebase to typescript with reformatted code using prettier)
The issue is that the incoming (develop) and the current (feature/) have the same exact change as shown below in the top two red boxes. Although the common parent node is different, shouldn't git be able to resolve this automatically upon the merge since the incoming and current commits are the same?
I'm tired of handling conflicts where both incoming and current are the same. I'm wondering if I'm just using git incorrectly or if this is normal. Any insight or suggestion is appreciated. This might be a newbie question, but I can't find answers online.. thank you.
VSCode Git MergeTool Screenshot
What I've tried: I ran the prettier formatter that I used on the develop branch in hopes that I would have less conflicts. It did reduce the number of files with conflicts by half, but I'm still seeing conflicts such as the one shown even though both incoming and current are the same.
Upvotes: 0
Views: 41
Reputation: 535999
It's a fair question, but this is simply how Git automerge works. As soon as Git determines that both wings of the merge have contributed to the same region of the target file, it stops thinking about the matter: that's a conflict. It doesn't proceed to ask a second question about what's happening, namely whether the two contributions to the same region of the target file are the same as one another.
You can reprogram Git's merge behavior, but that's probably more work than you really want to do.
I'm tired of handling conflicts where both incoming and current are the same
As has already been commented, if this is a common occurrence, you may be using merge incorrectly (actually it sounds like what you used incorrectly was "the prettier formatter"). But without further information, it's impossible to say more — and in any case, that's not what you asked.
Upvotes: 2