我正在尝试在.gitattributes中解决没有扩展名的文件:
* text=auto
*. eol=lf
.py eol=lf
*.
显然无济于事。 git check-attr --all -- ./foo
输出:
./ foo:text:auto
如何做到这一点?
答案 0 :(得分:3)
我认为您必须为所有文件设置所需的值,然后删除扩展名为的文件的属性:
* 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