Search code examples
gitvisual-studiomerge-conflict-resolutionbeyondcompare

BeyondCompare 3-way merge center window is not common ancestor


I'm using Beyond Compare to do a 3-way merge. I have Visual Studio 2022 and Git for Windows (git version 2.37.1.windows.1).
The problem is in Beyond Compare the center window is not the common ancestor.

How do I configure the center window to be the common ancestor?

Here's the scenario: In Visual Studio 2022, I do a Git Pull and it tells me I have a merge conflict; I double-click the filename and Beyond Compare opens a 3-way merge, but the common ancestor is in the left window, local changes in center, and incoming changes in right.

I followed these instructions from the Beyond Compare website:

git config --global diff.tool bc

git config --global difftool.bc.path "c:/Program Files/Beyond Compare 4/bcomp.exe"

git config --global merge.tool bc

git config --global mergetool.bc.path "c:/Program Files/Beyond Compare 4/bcomp.exe"

git config --global difftool.prompt false

git config --global mergetool.keepBackup false


Solution

  • Thanks for the updated link on Beyond Compars Website, switching $LOCAL and $REMOTE works for me.

    C:\Program Files\Beyond Compare 4\BComp.exe "$LOCAL" "$REMOTE" "$BASE"
    -o "$MERGED"
    

    I noticed also that sourcetree is filling automatically this order:

    enter image description here