2

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

  • 1
    [I posted this question on the Beyond Compare website](https://forum.scootersoftware.com/forum/beyond-compare-4-discussion/version-control-aa/88610-beyondcompare-3-way-merge-center-window-is-not-common-ancestor) – Scott McCosh Aug 25 '22 at 14:22
  • From the Beyond Compare forum: I think there is problem with GIT FOR WINDOWS setup using only mergetool.bc.path without specifying order of the files. I have to use following command using mergetool.bc.cmd to make it Current Base Incoming (you could switch $LOCAL and $REMOTE for Incoming Base Current) instead of Base Incomming Current. git config --global mergetool.bc.cmd "'c:/program files/beyond compare 4/BComp.exe' "$LOCAL" "$REMOTE" "$BASE" "$MERGED"" – Scott McCosh Mar 10 '23 at 22:28

1 Answers1

0

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

wejoey
  • 216
  • 1
  • 3
  • 14
  • [BC Forum](https://forum.scootersoftware.com/forum/beyond-compare-4-discussion/version-control-aa/88610-beyondcompare-3-way-merge-center-window-is-not-common-ancestor) I think there is problem with GIT FOR WINDOWS setup using only mergetool.bc.path without specifying order of the files. I have to use following command using mergetool.bc.cmd to make it Current Base Incoming (you could switch $LOCAL and $REMOTE for Incoming Base Current) instead of Base Incomming Current. git config --global mergetool.bc.cmd "'c:/program files/beyond compare 4/BComp.exe' "$LOCAL" "$REMOTE" "$BASE" "$MERGED"" – Scott McCosh Mar 10 '23 at 22:30