我想在 Git 中使用 SemanticMerge 作为我的 merge 工具,但是当我尝试执行 merge 时,我收到来自 SemanticMerge 的投诉,说它找不到文件 C:\Program Files (x86)\Git\my_repo_name\my_project\MyFile.cs.BASE.1234.cs
- 这是绝对正确的,因为它应该位于 C:\repositories\my_repo_name\my_project\MyFile.cs
等等。出于某种原因,虽然 Git 在其他方面都与存储库一起工作,但它似乎决定传递 $BASE、$LOCAL 和 $REMOTE 文件路径,并在前面加上 Git 安装路径而不是存储库根目录。
我一直在使用 their own tutorial 中建议的配置作为这方面的起点,如果给定正确的路径,该工具似乎可以正常工作,所以我猜测 Git 和 MsysGit 之间的某个地方存在一些错误配置或沟通不畅。
最佳答案
我不确定 SemanticMerge 配置是否是您的问题,但如果是,您可以尝试使用这些设置。我在我的工作机器上运行它,但这些是我的个人机器设置,所以它们可能还没有更新。顺便说一句,这些设置适用于 Windows 7 上的 msysgit:
[mergetool "sm"]
keepBackup = false
trustExitCode = false
cmd = 'C:/Users/<user>/AppData/Local/PlasticSCM4/semanticmerge/semanticmergetool.exe' -b=\"$BASE\" -d=\"$LOCAL\" -s=\"$REMOTE\" -r=\"$MERGED\" -l=csharp -emt=\"mergetool.exe -b=\"\"@basefile\"\" -bn=\"\"@basesymbolic\"\" -s=\"\"@sourcefile\"\" -sn=\"\"@sourcesymbolic\"\" -d=\"\"@destinationfile\"\" -dn=\"\"@destinationsymbolic\"\" -r=\"\"@output\"\" -t=\"\"@filetype\"\" -i=\"\"@comparationmethod\"\" -e=\"\"@fileencoding\"\"\" -edt=\"mergetool.exe -s=\"\"@sourcefile\"\" -sn=\"\"@sourcesymbolic\"\" -d=\"\"@destinationfile\"\" -dn=\"\"@destinationsymbolic\"\" -t=\"\"@filetype\"\" -i=\"\"@comparationmethod\"\" -e=\"\"@fileencoding\"\"\"
关于windows - Windows 上的 Git mergetool 一直从 Git 安装而不是存储库根目录中获得文件路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18316035/