git重置后留下未更新的变化--hard [英] Unstaged changes left after git reset --hard
问题描述
$ b
在之后> git reset --hard
, git status
给我的文件在中没有为commit提交:
节。
我也试过 git reset。
, git checkout - 。
和 git checkout- index -f -a
,无济于事。
那么,我该如何摆脱那些未分离的变化?
这似乎只打击了Visual Studio项目文件。奇怪的。查看此贴: http://pastebin.com/eFZwPn9Z 。这些文件的特殊之处在于.gitattributes中有:
*。sln eol = crlf
* .vcproj eol = crlf
* .vcxproj * eol = crlf
另外, autocrlf
在我的全局 .gitconfig
中设置为false。这可能有点相关?
好的,我解决了这个问题。
它似乎是 .gitattributes
文件,其中包含:
*。sln eol = crlf
* .vcproj eol = crlf
* .vcxproj * eol = crlf
使项目文件显示为不冻结。我无能为力,我真的希望有人知道git的方式会给我们一个很好的解释。
我的修复是删除这些文件,并在 这与前面的配置不完全一样,因为它要求每个开发者都有 编辑: 我评论了这些罪证行,它的工作。什么......我甚至不......! The title says it all. After I've also tried So, how can I get rid of those unstaged changes? This seems to hit only Visual Studio project files. Weird. See this paste: http://pastebin.com/eFZwPn9Z. What is special with those files, is that in .gitattributes I have: Also, Okay, I've kind of solved the problem. It seemed that the made the project files appear unstaged. I am clueless why that is, and I'm really hoping that someone privy to the ways of git will give us a nice explanation. My fix was to remove these files, and to add This does not amount to exactly the same thing as the previous configuration, as it requires every dev to have EDIT: I commented the incriminating lines, uncommented them and it worked. What the ... I don't even ... ! 这篇关于git重置后留下未更新的变化--hard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! .git / config 中添加
autocrlf = false
[core]
code $。
autocrlf =假
。我想找到一个更好的解决方案。
git reset --hard
, git status
gives me files within the Changes not staged for commit:
section.git reset .
, git checkout -- .
and git checkout-index -f -a
, to no avail.*.sln eol=crlf
*.vcproj eol=crlf
*.vcxproj* eol=crlf
autocrlf
is set to false in my global .gitconfig
. Could that be somehow relevant?.gitattributes
file, containing:*.sln eol=crlf
*.vcproj eol=crlf
*.vcxproj* eol=crlf
autocrlf = false
under [core]
in .git/config
.autocrlf = false
. I'd like to find a better fix.