我决定通过.gitattributes文件详细设置我的行结束正确的方式- 例如这里 - 所以我将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
# 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
Run Code Online (Sandbox Code Playgroud)
然后我按照这里的建议发布git rm --cached -r .然后git reset --hard(也尝试过git checkout HEAD).现在所有文件都有LF行结尾.不应该是CRLF?我错过了什么?我在Windows 7上.git version 1.8.0.msysgit.0
谢谢