Files without extensions in .gitattributes

本小妞迷上赌 提交于 2019-12-12 15:15:37

问题


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

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

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

./foo: text: auto

How can this be done?


回答1:


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

It will give the result:

$ 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


来源:https://stackoverflow.com/questions/44805861/files-without-extensions-in-gitattributes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!