我在使用 Visual Studio 时遇到了一个奇怪的问题。 GIT 集成一直很好,直到我升级了整个系统。我正在 Mac OSX El Capitan 上运行虚拟机(使用 VMWare Fusion 8.0.2)。这是我升级的内容:
- Windows 7 -> Windows 10
- Visual Studio 2013 专业版 -> Visual Studio 2015 企业版
- Git 1.9.x -> Git 2.6.3
安装了 Git 2.6.3 后,解决方案资源管理器中的所有文件都显示红色勾号(“待编辑”)。但是,文件没有任何更改,而是应显示蓝色锁定符号。对于此问题,我无法在解决方案资源管理器中看到哪些文件已更改。我注意到这与 Git 升级有关。我回到了 Git 1.9.5,Visual Studio 集成正常工作。该问题出现在 VS 2013 和 VS 2015 中。
还有人遇到同样的问题吗?是否有已知的解决方法可以使最新的 Git 版本与 Visual Studio 兼容?
下面是在解决方案资源管理器中显示问题的图片:
最佳答案
all my files in the Solution Explorer show the red check ("Pending Edit").
这可能是由于全局设置更改了 checkout 时所有文件的 eol(行尾)。
git config --global core.autocrlf false
OP Alexander Fuchs确认in the comments :
Changing a file, undoing the changes (the file is marked as edited and shows up in changed files).
After this, checkout the file from the repository and voila, the state of the file updates now correctly in Visual Studio.
关于Git 2.6.3 和 Visual Studio 2013/2015 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33967950/