git VisualStudio:libgit2 引发错误。类别 = 结帐

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18782637/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 16:57:04  来源:igfitidea点击:

VisualStudio: An error was raised by libgit2. Category = Checkout

gitvisual-studioversion-controltfs

提问by Null Reference

I'm using TFS with Git, installed Visual Studio Tools for Git.

我正在将 TFS 与 Git 一起使用,并安装了 Visual Studio Tools for Git。

I'm trying to pull all commits (5 in total) from TFS, but I get this error below:

我正在尝试从 TFS 中提取所有提交(总共 5 个),但出现以下错误:

An error occurred. Detailed message: An error was raised by libgit2. 
Category = Checkout (MergeConflict).
2 conflicts prevent checkout

How do I resolve this?

我该如何解决?

error

错误

采纳答案by dthrasher

Sadly, the Visual Studio plugin for Git doesn't display the error messages you need to troubleshoot this problem. (I hope they plan that feature for a later release.)

遗憾的是,适用于 Git 的 Visual Studio 插件没有显示解决此问题所需的错误消息。(我希望他们计划在以后的版本中使用该功能。)

Try pulling the latest commits using Git Bash or using TortoiseGit. Either of those tools should let you know where your conflicts are.

尝试使用 Git Bash 或使用TortoiseGit拉取最新提交。这些工具中的任何一个都应该让您知道您的冲突在哪里。

回答by Олег Крымский

To see the error you should run git command line You can find it at Team Emplorer-> Unsynched commits-> Actions-> Open in Command Prompt

要查看错误,您应该运行 git 命令行 您可以在Team Emplorer-> Unsynched commits-> Actions->Open in Command Prompt

Then you should use git pullcommand

那么你应该使用git pull命令

Be careful with credential if you are using visualstudio.com, in this case you must have an alternative login and password for connect to git from command prompt.

如果您正在使用凭证,请小心使用visualstudio.com,在这种情况下,您必须有一个备用登录名和密码才能从命令提示符连接到 git。

回答by user3848772

For resolving the issue follow below steps:-

要解决此问题,请按照以下步骤操作:-

1)Close visual studio.
2)Now Open visual studio without opening any solution..
3)Open team viewer and then go to git home->changes..
4)Then click on commit..
5)Now you will get the unresolved conflicts..
6)Resolve the conflicts and commit..

1)关闭视觉工作室。
2)现在打开visual studio而不打开任何解决方案..
3)打开团队查看器,然后转到git home->changes..
4)然后点击提交..
5)现在你会得到未解决的冲突..
6)解决冲突和提交..

Problem Resolved :).
Cheers

问题已解决:)。
干杯

回答by Blowsie

This error often occurs when:

在以下情况下经常发生此错误:

  • You have a proxy on your network:

    See some solutions on configuring your git proxy settings here.

  • or... The git url you are trying to connect to is over 256 characters

  • 您的网络上有一个代理:

    此处查看有关配置 git 代理设置的一些解决方案。

  • 或...您尝试连接的 git url 超过 256 个字符

回答by Manik Arora

Visual Studio Tool for Git didn't supported the remote repositories using the SSH protocol, only HTTP and HTTPS were supported but now it supports SSH as well.

Visual Studio Tool for Git 不支持使用 SSH 协议的远程存储库,仅支持 HTTP 和 HTTPS,但现在它也支持 SSH。

See the url on how to resolve this- https://github.com/libgit2/libgit2sharp/issues/255

请参阅有关如何解决此问题的 网址 - https://github.com/libgit2/libgit2sharp/issues/255

回答by Tarun

I was able to resolve this by doing a pull from Team Explorer in VS 2013 without having any solution open. Just do this one time.

我能够通过从 VS 2013 中的团队资源管理器中拉取来解决这个问题,而没有打开任何解决方案。只做一次。

This worked, and since then I haven't seen libgit error for any other solution as well.

这有效,从那时起我也没有看到任何其他解决方案的 libgit 错误。

This is tested for VS 2012 as well.

这也针对 VS 2012 进行了测试。

回答by Dayan

This happens when your incoming fetchconflicts with your uncommitted files. first try to commit the changes you did or undo them. And try to push again. if it doesn't work, the conflict file should be in the Untracked files. Try to find it and delete it. this should work.

当您传入的提取与未提交的文件发生冲突时,就会发生这种情况。首先尝试提交您所做的更改或撤消它们。并尝试再次推动。如果它不起作用,冲突文件应该在Untracked files 中。尝试找到它并删除它。这应该有效。

回答by Vitalik Demko

Incoming and Outgoing commits in different branches. You must to marge them before sync. I do it in Source Tree, there you can clearly see branching.

不同分支中的传入和传出提交。您必须在同步之前对它们进行标记。我是在 Source Tree 中做的,在那里你可以清楚地看到分支。

回答by Mihir

First you need to commit local pending changes in local branch.then pull from master branch. resolved conflicts and push the local changes on master branch

首先,您需要在本地分支中提交本地未决更改。然后从主分支中拉取。解决冲突并在 master 分支上推送本地更改

回答by Youngjae

Got a hint from @Blowsie, in my case, turned off fiddler capturing or similar packet capturing tool.

从@Blowsie 那里得到了一个提示,就我而言,关闭了提琴手捕获或类似的数据包捕获工具。