git reset --hard之后,git statusChanges not staged for commit:部分中为我提供了文件。

我也尝试了git reset .git checkout -- .git checkout-index -f -a,但无济于事。

那么,我该如何摆脱那些未进行的变更呢?

这似乎只命中Visual Studio项目文件。奇怪的。看到此粘贴:http://pastebin.com/eFZwPn9Z。这些文件的特殊之处在于,我在.gitattributes中具有:

*.sln        eol=crlf
*.vcproj     eol=crlf
*.vcxproj*   eol=crlf

另外,我的全局autocrlf中的.gitconfig设置为false。可能以某种方式相关吗?

最佳答案

我有同样的问题,它与.gitattributes文件有关。
但是,导致问题的文件类型未在.gitattributes中指定。

我能够通过简单地运行来解决问题

git rm .gitattributes
git add -A
git reset --hard

08-27 11:16