在Visual Studio中使用Git"冲突阻止检出"错误

Jim*_*lum 63 git conflict visual-studio visual-studio-2013

我在Visual Studio中使用Git.当我尝试同步时,会出现以下消息:

发生错误.详细消息:libgit2引发了一个错误.Cetegory =结账(MergeConflict).1冲突阻止结账

我不知道冲突是什么以及如何解决它们.任何人都可以帮我解决这个问题吗?

Mak*_*aks 53

我通过在Visual Studio中使用Git命令提示符解决了同样的问题,因为它为您提供了更多功能:

http://msdn.microsoft.com/en-us/library/vstudio/dd286572.aspx

您也可以安装此扩展程序以便于使用它(它使您无法每次都输入密码):

http://gitcredentialstore.codeplex.com/

然后我使用了这个命令:

git pull // I got an error on this step
git stash
git pull
Run Code Online (Sandbox Code Playgroud)

有关命令的更多信息:

http://git-scm.com/docs/git-pull

http://git-scm.com/book/en/Git-Tools-Stashing

http://git-scm.com/docs/git-commit

正如CharlesB所说,这是由于"你的变化与另一个分支的变化之间的冲突".

  • 好吧,你实际做的只是将你的开放式更改移动到另一个"藏匿"以继续之后继续.当你这样做时请注意这一点.另一个选择是撤消所有挂起的更改(不排除) (2认同)
  • 如果您有兴趣从Visual Studio解决此问题,而不是从命令行执行此操作,请upvote:https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/4576531-provide-stash - 支持 - 在视觉工作室工具换-G (2认同)

Dac*_*chi 34

你有一些未经修改的变化.提交或撤消这些更改,然后Git"pull"将起作用.