草庐IT

.net - 如何使用 LibGit2Sharp 获取当前/事件分支?

所以使用LibGit2Sharphttps://github.com/libgit2/libgit2sharp你可以像这样穿过Twigusing(varrepo=newRepository(@"pathto.git")){foreach(varbranchinrepo.Branches){Debug.WriteLine(branch.Name);}}但是如何获取当前/事件分支? 最佳答案 Branch.IsCurrentRepositoryHead应该可以解决问题。我认为如果您不想遍历分支,Repository.Head也会做同样的

git - VisualStudio : An error was raised by libgit2. 类别 = checkout

我将TFS与Git结合使用,安装了VisualStudioToolsforGit。我正在尝试从TFS中提取所有提交(总共5个),但出现以下错误:Anerroroccurred.Detailedmessage:Anerrorwasraisedbylibgit2.Category=Checkout(MergeConflict).2conflictspreventcheckout我该如何解决? 最佳答案 遗憾的是,适用于Git的VisualStudio插件不会显示解决此问题所需的错误消息。(我希望他们计划在以后的版本中使用该功能。)尝试使