.gitattributes中没有扩展名的文件 [英] Files without extensions in .gitattributes

查看:106
本文介绍了.gitattributes中没有扩展名的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试处理.gitattributes中没有扩展名的文件:

I'm trying to address files without extensions in .gitattributes:

* text=auto
*. eol=lf
.py eol=lf

*.显然无济于事. git check-attr --all -- ./foo输出:

*. clearly doesn't help. git check-attr --all -- ./foo outputs:

./foo:文本:自动

./foo: text: auto

这怎么办?

推荐答案

我认为您必须为所有文件设置所需的值,然后删除具有扩展名的文件的属性:

I think you have to set the value you want to all files, then remove the attribute for files with extension:

* text=auto eol=lf
*.* -eol # or set another default value
*.py eol=lf

它将给出结果:

$ git check-attr --all -- file
file: text: auto
file: eol: crlf
$ git check-attr --all -- foo.py
foo.py: text: auto
foo.py: eol: lf
$ git check-attr --all -- bar.txt
bar.txt: text: auto
bar.txt: eol: unset

这篇关于.gitattributes中没有扩展名的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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