How to use BeyondCompare from git mergetool in cygwin?

How to use BeyondCompare from "git mergetool" in cygwin?

+3
source share
2 answers

Here is a simple answer.

#! /bin/sh
LOCAL=`cygpath -wa $1`
REMOTE=`cygpath -wa $2`
BASE=`cygpath -wa $3`
MERGED=`cygpath -wa $4`
/cygdrive/c/BeyondCompare3/BComp.exe $LOCAL $THEIRS $BASE $MERGED

Or as in git configuration.

[mergetool "mergetool"]
    cmd = /cygdrive/c/BeyondCompare3/BComp.exe `cygpath -wa "$LOCAL"` `cygpath -wa "$REMOTE"` `cygpath -wa "$BASE"` `cygpath -wa "$MERGED"`

I use cygpath (which comes with cygwin) to convert paths. The flag is -wconverted from the cygwin format (starting with / cygdrive / c) to the Windows format (starting from c :). The flag -auses absolute file names.

Note. I do not have a Pro BeyondCompare license, so I cannot test the merge correctly, but it opens the first two files correctly.

+3
source
+2

Source: https://habr.com/ru/post/1763172/


All Articles