【发布时间】:2014-10-23 14:44:10
【问题描述】:
我有一个修改过的文件:
$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: vw_static.vcxproj
#
即使在git reset --hard 和git checkout -- vw_static.vcxproj 之后。
git diff 似乎仅表示空白(特别是行终止)差异。
$ git config core.autocrlf
input
$ git config --global core.autocrlf
input
此项目中没有.git/info/attributes(也没有全局.gitattributes)。
我不关心这个项目中的行尾,我对更改这个特定文件不感兴趣(尤其是提交与它相关的任何内容)。
我想要的只是 git status 报告树未修改。
我如何得到它?
【问题讨论】:
-
你有 git 在推/拉时为你修改文件吗?看看git-scm.com/book/en/Customizing-Git-Git-Attributes 并搜索污迹。
-
@JustinWood:我没有 gitattributes。
-
@AndrewC:不,这是一个非常不同的问题(
Changed but not updatedvsUnstaged changes) -
当我标记标题读起来完全不同时。请发布确切的
git status和git diff输出。
标签: git