5

我一直在试图弄清楚在 Windows(cygwin)上使用 Git 时如何通过命令行进行配置。根据 Beyond compare 的文档,他们要求您只使用 bcomp.exe 安装的“路径”,一切都应该正常工作。但它不会自动获取“本地”、“基础”和“远程”参数。我正在使用 Beyond compare 3.0 PRO。

4

4 回答 4

11

我通过修改 git 配置找到了答案。注意:我在记事本中编辑了全局 git 配置,这是我完成后的配置。希望这可以帮助某人。

[diff]
 tool = bc4
[difftool "bc4"]
 cmd =  "C:/program\\ files\\ \\(x86\\)/beyond\\ compare\\ 4/bcomp.exe $LOCAL $REMOTE"
[merge]
 tool = bc4
[mergetool "bc4"]
 cmd = "C:/Program\\ Files\\ \\(x86\\)/Beyond\\ Compare\\ 4/Bcomp.exe $LOCAL $REMOTE $BASE $MERGED"
 trustExitCode = true
 keepBackup = false
于 2014-07-17T16:16:23.267 回答
2

除了比较版本 3。

对于 Linux 在终端中键入以下命令:

git config --global diff.tool bc3
git config --global difftool.prompt false
git config --global difftool.bc3 trustExitCode true

git config --global merge.tool bc3
git config --global mergetool.bc3 trustExitCode true

对于 windows 类型如下(你需要告诉 git bcomp.exe 的路径)

git config --global difftool.bc3.path "c:/program files (x86)/beyond compare 3/BCompare.exe"
git config --global mergetool.bc3.path "c:/program files (x86)/beyond compare 3/bcomp.exe"
于 2015-08-14T14:17:05.140 回答
1

为了让 Visual Studio 真正理解发生了合并,我必须像这样在路径周围加上单引号。这适用于 Windows 上的 Beyond Compare 4 Pro。

[diff]
    tool = bc
[difftool "bc"]
    cmd =  '"C:/Program Files/Beyond Compare 4/BComp.exe"' "$LOCAL" "$REMOTE"
[merge]
    tool = bc
[mergetool "bc"]
    cmd = '"C:/Program Files/Beyond Compare 4/BComp.exe"' "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
    trustExitCode = true
    keepBackup = false
于 2016-07-11T23:56:48.173 回答
0

只是一个后续说明:您可以使用以下代码直接从命令行编辑配置文件。- 它会启动你的命令行默认编辑器。

$ git config --global --edit

Ps 上面的提示也对我有用。我正在使用win7企业版。

于 2015-05-28T15:30:03.750 回答