从命令行看到以下内容后:
# On branch RB_3.0.10
# 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: index.htm
我试图通过输入以下命令来放弃我的更改:
git checkout -- index.htm
但是当我重新运行 git status 时,它看起来完全一样。结账好像不行。难道我做错了什么?我在 windows/cygwin 上使用 GIT 1.6.1.2。
# On branch RB_3.0.10
# 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: index.htm
这已经困扰我一段时间了,几乎我检查的每个存储库都有我无法丢弃的更改。长话短说,我尝试了以上所有方法,但没有任何效果。这就是我为了让事情恢复正常所做的(在 Mac 上):
Completely remove the autocrlf & safecrlf settings from ~/.gitconfig
Completely remove the autocrlf & safecrlf settings from your repo's local config ./.git/config
git rm --cached -r .
git reset --hard
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)