我正在使用cygwin上的Windows XP系统中的git 1.7.1版本。 下面通过一个例子来更好地说明这个问题:
$ 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: system/application/config/email.php
# modified: system/application/config/upload.php
# modified: system/application/views/frontend/business_subscription/start_subscription.php
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git checkout system/application/config/email.php
$ 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: system/application/config/email.php
# modified: system/application/config/upload.php
# modified: system/application/views/frontend/business_subscription/start_subscription.php
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff -w
Git显示列出的文件中有一些更改,但我无法摆脱这些更改-该文件仍然存在。
似乎只发生在除空格之外没有其他更改的文件上(因为git diff -w不输出任何内容)。
我认为这可能是由于git的crlf设置引起的,但我对此不确定。
git config --list
: core.autocrlf=input core.safecrlf=false - festgit add system/application/config/email.php
会发生什么? - CB Bailey