且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Studio - git pull 导致错误

更新时间:2023-11-07 22:54:16

Visual Studio 2013 到 Update 3 中存在一个错误,当您拥有 core.autocrlf 时,它会阻止您在某些情况下合并设置为 true 但存储库中的文件未正确规范化.我们正在将您的工作文件夹的内容(具有 Windows 样式的 ' 行结尾)与您声明的存储库内容进行比较(通过设置 core.autocrlf=true) 有 Unix 风格的 行结尾.

There is a bug in Visual Studio 2013 through Update 3 that will prevent you from merging in certain circumstances when you have core.autocrlf set to true yet the files in your repository are incorrectly normalized. We are comparing the contents of your working folder (which has Windows-style ' line endings) to the contents of your repository, which you have claimed (by setting core.autocrlf=true) have Unix style line endings.

如果实际上您的存储库包含带有 行结尾的文件,那么我们将错误地报告这些文件在您的工作目录中被修改并阻止合并.(当然,我们应该查看索引中的时间戳,而根本不需要测试这些文件.)

If, in fact, your repository contains files with line endings, then we will incorrect report these files as modified in your working directory and prevent the merge. (We should, of course, be looking at the timestamp in the index and not bothering to test these files at all.)

虽然这个 Visual Studio 中的一个错误(并将在下一个更新中修复),但它掩盖了您的存储库配置不正确的事实.您应该配置一个 .gitattributes 文件并更正该行 以避免此类问题.

While this is a bug in Visual Studio (and will be fixed in the next Update), it is obscuring the fact that your repository is not configured correctly. You should configure a .gitattributes file and correct the line endings in your repository to avoid these sorts of problems.

同时,您可以在命令行使用Git for Windows来解决这个问题,请务必Visual Studio 团队服务.

In the meantime, you can use Git for Windows on the command-line to solve this problem, please be sure to configure alternate credentials in Visual Studio Team Services.