【问题标题】:How to configure git difftool to work properly on WSL?如何配置 git difftool 以在 WSL 上正常工作?
【发布时间】:2022-11-12 10:09:05
【问题描述】:

我的 git diff 配置是:

mark@L-R910LPKW:~/.kube$ git config --list | grep diff
diff.tool=bc3
diff.guitool=bc3
difftool.prompt=false
difftool.bc3.path=/mnt/c/Program Files/Beyond Compare 4/BComp.com
mark@L-R910LPKW:~/.kube$

当我从 WSL 运行 git difftool 时,我得到如下信息:

显然,当我运行git diff 时,我在控制台上看到了预期的输出。

现在,根据ps,实际命令行是/tools/init /mnt/c/Program Files/Beyond Compare 4/BComp.com /tmp/maHQTa_config config

所以看起来config 已成功转换为 WSL 之外“理解”的 WSL 完整路径 -\\wsl.localhost\Ubuntu-20.04\home\mark.kube\config.然而,对于/tmp/maHQTa_config,即使它映射到\\wsl.localhost\Ubuntu-20.04\tmp\maHQTa_config

如果有的话,如何解决?

【问题讨论】:

    标签: git windows-subsystem-for-linux


    【解决方案1】:

    尝试使用:

    git config --global merge.tool bc3 
    

    然后添加 bc3 工具的路径:

     git config --global mergetool.bc3.path "C:......" 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-21
      • 2020-12-27
      • 1970-01-01
      • 1970-01-01
      • 2010-11-07
      相关资源
      最近更新 更多