【问题标题】:How to configure Beyond compare with Git command line如何配置 Beyond 与 Git 命令行比较
【发布时间】:2014-07-17 16:15:51
【问题描述】:

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

【问题讨论】:

    标签: git cygwin beyondcompare


    【解决方案1】:

    我通过修改 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
    

    【讨论】:

    • 似乎对我不起作用。如何测试出了什么问题?
    【解决方案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"
    

    【讨论】:

      【解决方案3】:

      为了让 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
      

      【讨论】:

        【解决方案4】:

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

        $ git config --global --edit

        附:上面的提示也对我有用。我用的是win7企业版。

        【讨论】:

          猜你喜欢
          • 2023-03-11
          • 1970-01-01
          • 2022-10-23
          • 1970-01-01
          • 2017-08-07
          • 2014-06-26
          • 2013-08-23
          相关资源
          最近更新 更多