gitattributes中的`* text = auto eol = lf`会做什么? [英] What will `* text=auto eol=lf` in gitattributes do?

查看:514
本文介绍了gitattributes中的`* text = auto eol = lf`会做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  * text = auto eol = lf 
c $ c>

我想要精确地理解它的作用。



第一个部分是 text = auto 。从文档


这确保所有Git认为是文本的文件将在存储库中具有标准化(LF)行结束符。


重要的部分是Git只对它检测为文本文件的文件进行标准化。



然而,我不确定 eol = lf 部分。我认为它也只会对文本文件进行规范化处理,但我无法在文档中找到它的支持,并且我们有一个实例,当我们的PNG文件也进行了规范化处理时,它们就会失效。



是否有像上面那样的设置,基本上会说为文本文件在两个方向进行标准化,并将二进制文件保留为 ?

解决方案

Git 2.10修正了这个,现在的行为和人们预期的一样。


We have this in our .gitattributes file:

* text=auto eol=lf

I'd like to precisely understand what this does.

The first part is text=auto. From the documentation:

This ensures that all files that Git considers to be text will have normalized (LF) line endings in the repository.

The important part is that Git does the normalization only for files that it detects as text files.

However, I'm not sure about the eol=lf part. I would think that it will also do the normalization only for text files but I can't find support for it in the documentation and we had an instance when our PNG files were normalized too, making them invalid.

Is there a settings like the above that would basically say "do the normalization in both directions for text files, and leave binary files alone"?

解决方案

Git 2.10 fixed this and now behaves as one would expect.

这篇关于gitattributes中的`* text = auto eol = lf`会做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆