从命令行看到以下内容后:
# 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
Run Code Online (Sandbox Code Playgroud)
我试图通过键入命令来放弃我的更改:
git checkout -- index.htm
Run Code Online (Sandbox Code Playgroud)
但是当我重新运行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: …Run Code Online (Sandbox Code Playgroud) 我有一个回购我添加了gitattributes它并正在努力它.我通过Dropbox将它同步到另一台机器.当我把它打开到另一台机器时,一堆文件突然出现在未分区的区域作为总差异(所有文件都是一个巨大的差异,这意味着行结束差异) - 我的crlf结局基本上是.* text=auto我在Windows上工作.我试图隐藏更改,重置分支等.最后我决定提交文件然后做了一些其他提交我想在行结束提交之前重新排序(和压缩).当我尝试变基时,我得到一个:
error: Your local changes to the following files would be overwritten by merge
# those same files
Please, commit your changes or stash them before you can merge.
Aborting
Could not apply 89b25b81fff1a1e7893319e123aaaca9c4162a95... <commit message>
Run Code Online (Sandbox Code Playgroud)
当然藏匿不起作用
这是一个错误吗?
有关:
编辑与机器无关 - 在同一台机器上,一些(......)操作只是使这些文件(它们在.gitattributes文本中)出现在"已更改"部分.似乎存在的唯一解决方法是:
git rm --cached -r .
git reset --hard
Run Code Online (Sandbox Code Playgroud)
小心使用
编辑:hack上面转移到别名状态:
[alias]
crlf = !git rm -r . …Run Code Online (Sandbox Code Playgroud)