开发者

How to use BeyondCompare from git mergetool in cygwin?

开发者 https://www.devze.com 2023-01-14 15:27 出处:网络
开发者_如何学编程How to use BeyondCompare from \"git mergetool\" in cygwin?Here\'s a simple answer.
开发者_如何学编程

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


Here's 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 your git config.

[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 the paths. The -w flag converts from cygwin format (starting with /cygdrive/c) to windows format (starting with c:). The -a flag uses absolute filenames.

Note: I don't have a Pro BeyondCompare license, so I can't test merge properly, but it is correctly opening the first two files.


I've found some scripts to convert cygwin paths (robustly, it seems) and launch BC3: http://gist.github.com/564573

0

精彩评论

暂无评论...
验证码 换一张
取 消