libgit2sharp 相当于 "git mergetool"

libgit2sharp equivalent of "git mergetool"

我想在 libgit2sharp 中使用 "git mergetool" 的等效项。有没有样本可以做到这一点?还是我必须深入研究并尝试在 libgit2sharp 中实现它?

调用 "git mergetool" 检查是否需要合并,并使用服务器的副本调用自定义合并工具。调用 mergetool 的正确方法将很有用。我知道我可以阅读配置并搜索 mergetool 及其 "cmd" 命令。

您好 托马斯

LibGit2Sharp 用于以编程方式与 git 存储库交互。它不会直接启动合并工具。

但是,您可以使用 LibGit2Sharp 从给定的存储库中检索配置值。例如,通过使用:

var mergeTool = repo.Config.Get<string>("merge.tool").Value;
var path = repo.Config.Get<string>("mergetool." + mergeTool + ".path").Value;

您可以检索配置的合并工具的路径。