Visual Studio 代码中的 Git 表示即使没有更改文件也会被修改 [英] Git in Visual studio code says file is modified even when there is no change

查看:104
本文介绍了Visual Studio 代码中的 Git 表示即使没有更改文件也会被修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 Visual Studio Code 用于我的销售队伍开发.我在将 Git 作为存储库时遇到了一些问题.当我右键单击 package.xml 并说 Retrieve Source From Org 时,它正在从 Org 获取所有文件.

I am using the Visual Studio Code for my salesforce development. I have some issues with Git as a repository. When I right-click on the package.xml and say Retrieve Source From Org, it is getting all the files from Org.

问题是 git 扩展名显示文件在服务器上被修改,即使我在本地有一个示例文件.即使没有更改,我也不想一次又一次地将所有文件推送到我的 git 存储库中.

The problem is git extension is showing file is modified on the server even though I have a sample file in my local. I don't want to push all the files again and again to my git repo even when there is no change.

知道为什么会发生这种情况以及如何避免这种情况吗?

Any idea why this is happening and how to avoid it?

更新:我做了 git diff,它提供了正确的输出.它只显示被修改的文件更改.在这种情况下只有五个.

Update: I did git diff and it provides correct output. It only shows file changes that are modified. In this case only five.

推荐答案

我能够通过执行以下命令来解决它

I was able to resolve it by executing the following command

git config --global core.autocrlf false

这篇关于Visual Studio 代码中的 Git 表示即使没有更改文件也会被修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆