* text=auto eol=lf
我想要准确地了解这样做.
第一部分是text = auto.从documentation:
This ensures that all files that Git considers to be text will have normalized (LF) line endings in the repository.
重要的部分是Git仅对其作为文本文件检测到的文件进行归一化.
但是,我不确定eol = lf部分.我会认为它也将仅对文本文件进行规范化,但是在文档中找不到它的支持,当我们的PNG文件被归一化时,我们有一个实例,使它们无效.
解决方法
相关:feature proposal on Git mailing list
* text=auto
This will correctly normalize text files in the repo. However,the
second part (LF forcing on checkout) cannot be achieved easily today
because addingeol=lf
will unfortunately process binary files too.
The only solution today is to mark certain types for conversion (e.g.,
*.txt eol=lf
) or,inversely,mark certain types as binary (e.g.,
*.png binary
).Both of these suffer from the same issue: the specific file types must
be listed explicitly in the.gitattributes
file,which means that
either the types must be kNown ahead of time or all developers must
remember to update the.gitattributes
file every time a new file type appears in the project. Which they won’t.
原文地址:https://www.jb51.cc/html/230624.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。