git行结尾:重新标准似乎没有检出正确的行尾 [英] git line endings : renormalize does not seem to checkout the right line endings
问题描述
我决定通过一个 .gitattributes
文件来设置我的行结束符,如 here - 所以我将core.autocrlf设置为false并创建并提交了.gitattributes文件:
*。java text eol = native
* .jsp text eol = native
* .css text eol = native
* .html text eol = native
* .js text eol = native
* .xml text eol = native
* .sql text eol = native
* .MF text eol = native
$ b $ git文件
* .gitignore text eol = native
* .gitattributes text eol = native
#eclipse文件
* .classpath text eol = native
* .project text eol = native
.prefs text eol = native
* .properties text eol = native
然后我发行 git rm --cached -r。
然后 git reset --hard
(也尝试 git checkout HEAD
),如此处。现在所有文件都有LF行尾。不应该是CRLF?我错过了什么?我在Windows 7上, git version 1.8.0.msysgit.0
。
谢谢
它必须是 bug 。奇怪的是它并没有被固定或报告 - 这整个混乱是关于窗口的,而且它不能在窗口上正常工作?此外,它没有提及任何地方(?)
编辑:从mingw最新的版本库目录安装 - g ++,gcc,ObjC + MinGW开发者工具包和MSYS -1.0.11。同样的行为。每当我尝试提交CRLF文件时,我都会将 CRLF替换为(在结帐时隐含)警告。编辑2: 似乎即将修复
编辑3:这已在Git 1.8.4中修复。
I decided to set my line endings the Right Way via a .gitattributes
file as detailed for instance here - so I set the core.autocrlf to false and created and committed a .gitattributes file :
*.java text eol=native
*.jsp text eol=native
*.css text eol=native
*.html text eol=native
*.js text eol=native
*.xml text eol=native
*.sql text eol=native
*.MF text eol=native
# git files
*.gitignore text eol=native
*.gitattributes text eol=native
#eclipse files
*.classpath text eol=native
*.project text eol=native
*.prefs text eol=native
*.properties text eol=native
I then issued git rm --cached -r .
and then git reset --hard
(tried also git checkout HEAD
), as suggested here. Now all the files have LF line endings. Shouldn't be CRLF ? What do I miss ? I am on windows 7, git version 1.8.0.msysgit.0
.
Thanks
It must be a bug. It is strange it is not fixed or reported really - this whole mess is about windows, and it does not work precisely on windows ? Moreover there is no mention of it anyplace (?)
EDIT : Installed from the mingw "latest repository catalogues" - g++, gcc, ObjC + the MinGW Developer Toolkit and MSYS-1.0.11. Same behavior. Whenever I try to commit a CRLF file I get the CRLF will be replaced with LF (on checkout is implied) warning.
EDIT 2 : seems about to be fixed
EDIT 3: This has been fixed in Git 1.8.4.
这篇关于git行结尾:重新标准似乎没有检出正确的行尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!