git libgit2 引发了一个错误。类别 = 21(合并冲突)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22697183/
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-19 09:54:19  来源:igfitidea点击:

An error was raised by libgit2. Category = 21 (MergeConflict)

gitvisual-studio-2013

提问by TheRealDanBiss

I am using VS 2013.

我正在使用 VS 2013。

I am stuck. Everything is committed to my local repository. I try to pull from remote and I get the following error:

我被困住了。一切都提交给我的本地存储库。我尝试从远程拉取,但出现以下错误:

An error occurred. Detailed message: An error was raised by libgit2. Category = 21 (MergeConflict). 1 uncommitted change would be overwritten by merge

发生错误。详细消息:libgit2 引发错误。类别 = 21(合并冲突)。1 个未提交的更改将被合并覆盖

I have no uncommitted changes...that I'm aware of.

我没有未提交的更改……我知道。

采纳答案by TheRealDanBiss

Looks like running git pull from the command prompt allowed me to execute the pull. I was unfamiliar with the command prompt.

看起来从命令提示符运行 git pull 允许我执行拉取。我不熟悉命令提示符。

回答by Edward Thomson

Typically, you will see this message when you have modified a file, but not staged the changes, and the merge you are attempting would write to that file. Visual Studio 2013, unfortunately, contains a bug where it determines that your file is modified even though it is not. The bug manifests when you have a file in your repository that has line endings that disagree with what should have been produced, given your core.autocrlfsettings.

通常,当您修改文件但未暂存更改时,您会看到此消息,并且您尝试的合并将写入该文件。不幸的是,Visual Studio 2013 包含一个错误,它确定您的文件被修改,即使它没有被修改。根据您的设置,当您的存储库中有一个文件的行尾与本应生成的内容不一致时,该错误就会显现出来core.autocrlf

This bug is fixed in Visual Studio 2013 Update 2: http://support.microsoft.com/kb/2927432

此错误已在 Visual Studio 2013 更新 2 中修复:http: //support.microsoft.com/kb/2927432