Git 2.6.3 和 Visual Studio 2013/2015 集成

标签 git visual-studio visual-studio-2013 visual-studio-2015

我在使用 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 兼容?

下面是在解决方案资源管理器中显示问题的图片:

使用 Git 2.6.3,所有文件如下所示:enter image description here

使用 Git 1.9.5,文件被正确识别为未修改:enter image description here

最佳答案

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/

相关文章:

Git 忽略陌生事物

git - Windows 上的接收后 Hook 和 Jenkins

Git无法使用私有(private)ssh文件连接到远程

c# - 将自定义格式添加到模板参数 Visual Studio 项目

c++ - 您知道用于编辑/翻译资源 (.rc) 文件的好程序吗?

sql - 如何在 Visual Studio 中的 Sql Server Data Tools Editor 中更改连接

git - 每次 git push 完成后更新版本?

c++ - 在 Visual Studio 中更改类的默认选项卡结构

visual-studio-2013 - 如何自动备份Visual Studio项目?

c# - 改变控制台颜色,给我一个 Stackoverflow 异常