如何在不更改 Git 的情况下取消暂存文件? [英] How to unstage files with no changes in Git?

查看:32
本文介绍了如何在不更改 Git 的情况下取消暂存文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 VS 2017.

I am working with VS 2017.

提交时,我可以看到一些没有突出显示更改的文件出现在更改下.
有 50 多个没有任何更改的文件在更改下.

While committing, I could see some files which had no changes highlighted are present under changes.
There were more than 50 files without any changes are present under changes.

任何人都可以帮助我如何从更改中删除它们并仅暂存修改过的文件.

Could anyone please help me with how to remove them from changes and stage only modified files.

推荐答案

首先在命令行中检查您的 git config core.autocrlf 值.

Check first in command-line your git config core.autocrlf value.

如果您看到 true:

  • 关闭 Visual Studio
  • 将其更改为 false:git config --global core.autocrlf false(见 这个线程)
  • 转到您的项目根文件夹和(使用 Git 2.16+)git add --renormalize .
  • 打开备份 Visual Studio

看看所有这些文件是否仍然更改".

See if all those files are still "changed".

这篇关于如何在不更改 Git 的情况下取消暂存文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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