使'git status'忽略空白更改
使'git status'忽略空白更改,git,whitespace,removing-whitespace,git-status,Git,Whitespace,Removing Whitespace,Git Status,git status告诉我,修改的文件很少。但是当我使用下面的任何参数执行git diff时,它是空的 --ignore-space-at-eol Ignore changes in whitespace at EOL. -b, --ignore-space-change Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers a
git status
告诉我,修改的文件很少。但是当我使用下面的任何参数执行git diff
时,它是空的
--ignore-space-at-eol
Ignore changes in whitespace at EOL.
-b, --ignore-space-change
Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.
-w, --ignore-all-space
Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none.
我尝试了git checkout.
重置此更改,但没有帮助。我如何将这些文件回滚到原始状态(这样它们就不会再被“修改”)或永久忽略空白更改
git reset--hard
也不起作用。如果要放弃当前git回购中的所有更改
使用,git签出--.
对于未跟踪的文件,请使用git clean-n
检查需要清理的文件(如果有)
注:
小心使用git reset--hard,这会删除所有未提交的文件。更改将永久丢失(无法恢复)。晚会延期5年,但
我在导出Drupal8配置(
DrushCEX
)时经常遇到这种情况。我将立即运行git stash save
,然后运行git stash pop
<代码>git状态然后只报告有实际更改的文件。这不会回答问题question@MohammedRafeeq请告诉我上述问题是否没有回答“如何将这些文件回滚到原始状态(这样它们就不会被“修改”)。