【发布时间】:2015-04-03 07:37:12
【问题描述】:
我在我的 git install (CentOS) 的根目录中创建了一个 .gitattributes 文件。我已经通过 samba 共享连接在 PHPStorm 中创建了测试文件,并将行尾设置为 CRLF。我添加并提交了测试文件,希望文件的行尾更改为 LF,但是当我在 vim 中检查文件时,它会在我打开文件时在文件名旁边显示:[noeol][dos]。似乎 .gitattributes 文件没有转换为 LF ......我不正确吗?我很确定我已经正确设置了属性(见下文)。我做错了吗?
# Set the default behavior, in case core.autocrlf is not set
* text=auto
# Explicitly declare text files you want to always be normalized and converted to native line endings
*.htm text
*.html text
*.tpl text
*.css text
*.js text
*.php text
*.xml text
*.txt text
*.ini text
*.inc text
*.bak text
*.pm text
*.cgi text
.htaccess text
# Denote all files that are truely binary and should not be modified
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
【问题讨论】:
-
你在哪里有那个属性文件?您将
eol属性和core.eolgit config 设置设置为什么? -
该文件与 .git 文件夹位于同一目录中。 - 并且根本没有设置 core.eol 属性。