问题
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