git - 如何在 cygwin 中使用来自 git mergetool 的 BeyondCompare?

标签 git merge cygwin beyondcompare mergetool

如何在 cygwin 中使用“git mergetool”中的 BeyondCompare?

最佳答案

这是一个简单的答案。

#! /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

或者在你的 git 配置中。

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

我使用 cygpath(cygwin 自带)来转换路径。 -w 标志从 cygwin 格式(以/cygdrive/c 开头)转换为 windows 格式(以 c: 开头)。 -a 标志使用绝对文件名。

注意:我没有 Pro BeyondCompare 许可证,所以我无法正确测试 merge ,但它可以正确打开前两个文件。

关于git - 如何在 cygwin 中使用来自 git mergetool 的 BeyondCompare?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3639785/

相关文章:

Git:仅可视化 "tags"

git - 推荐多平台、便携、学习模式的 Git GUI?

eclipse - 如何使用 Subclipse 在 Eclipse 中从分支合并到主干?

visual-studio - 使用 gcc 在 Cygwin 中编译库 (redland) 并使用 Visual Studio (c++) 中的输出

git - GoDaddy 出站 SSH 与 Git 克隆问题

Git merge "replays"发生变化,但是呢?

python - 根据python pandas中的行值合并两个数据框

git - GitLab 是否允许 wiki merge 请求?

Cygwin、gcc 和 C_INCLUDE_PATH

cygwin - 为什么 cygwin mintty 会自己输入 8~(代字号)?