libgit2sharp 相当于"git mergetool"



我想在libgit2sharp中使用相当于"git mergetool"的词。有没有示例来执行此操作?还是我必须深入研究并尝试在libgit2sharp中实现它?

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

问候托马斯

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

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

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

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

最新更新