试图获得git和更多的比较,以便在WSL上很好地放在一起。这是git config --list的输出
diff.tool=bc3
difftool.prompt=false
difftool.bc3.path=/mnt/c/Program Files/Beyond Compare 4/BComp.exe
merge.tool=bc3
mergetool.prompt=false
mergetool.bc3.trustexitcode=true
mergetool.bc3.path=/mnt/c/Program Files/Beyond Compare 4/BComp.exe这是我的~/.gitconfig
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
path = /mnt/c/Program Files/Beyond Compare 4/BComp.exe
[merge]
tool = bc3
[mergetool]
prompt = false
[mergetool "bc3"]
trustExitCode = true
path = /mnt/c/Program Files/Beyond Compare 4/BComp.exe我的git --version is
git version 2.25.1当我尝试使用左侧窗格中的当前版本打开git difftool file_in_git_repo Beyond时,右窗格中没有任何内容(我已经确认该文件存在于git中)。
.git/config没有引用diff或merge的条目。
如有任何建议,欢迎
========================================================================
类似于VonC的建议,我能够让它在我的.gitconfig文件(免责声明-我还没有使用这个新方法合并工具)中处理这个问题:
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
cmd = '/mnt/c/Program Files/Beyond Compare 4/BComp.exe' \"$(wslpath -aw $LOCAL)\" \"$(wslpath -aw $REMOTE)\"
[merge]
tool = bc3
[mergetool]
prompt = false
[mergetool "bc3"]
trustExitCode = true
cmd = '/mnt/c/Program Files/Beyond Compare 4/BComp.exe' \"$(wslpath -aw $LOCAL)\" \"$(wslpath -aw $REMOTE)\"发布于 2022-02-12 22:58:40
检查这种配置在您的情况下是否可以工作:
我设法使它工作使用内置wslpath命令,这与新的WSL版本! 我在WSL linux端的git配置: difftool.bc3.cmd=BComp.exe "$(wslpath -aw $LOCAL)“$(wslpath -aw $REMOTE)”mergetool.bc3.cmd=BComp.exe "$(wslpath -aw $LOCAL)“$(wslpath -aw $REMOTE)”“$”(wslpath -aw $BASE)“$(wslpath -aw $MERGED)”
BComp.exe在我的$PATH里。 我在Windows 2004 (build 19041)上使用WSL2,这既适用于WSL文件系统,也适用于安装的Windows文件系统。 新的wslpath -aw转换Linux路径如下: $ wslpath -aw /home/ \wsl$\Debian\home Windows路径如下: $ wslpath -aw /mnt/c/Users/ C:\Users 这使得它们在从Linux启动时都能很好地与BC的Windows版本一起工作。
https://stackoverflow.com/questions/71093803
复制相似问题