Visual studio - git pull causes error

后端 未结 1 1040
耶瑟儿~
耶瑟儿~ 2021-01-21 17:00

I have a Git repository on Visual Studio Team Services. When I try to pull commits, I get the following error:

18 uncommitted changes would be overwritten by

1条回答
  •  清酒与你
    2021-01-21 17:12

    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 '\r\n line endings) to the contents of your repository, which you have claimed (by setting core.autocrlf=true) have Unix style \n line endings.

    If, in fact, your repository contains files with \r\n 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.)

    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.

    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.

    0 讨论(0)
提交回复
热议问题