根据Force LF line endings using .gitattributes without losing automatic text/binary inference?当我将.gitattributes设置为仅包含

* text=auto
* text eol=lf

那么所有文本文件都应转换为LF行结尾,并且二进制文件应保持不变-这就是我想要的。但是不知何故,此处无法正确检测二进制文件。在Windows下查看git bash控制台的以下输出:
$ git add .
warning: CRLF will be replaced by LF in clip2txt.exe.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in raw.png.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in test.
The file will have its original line endings in your working directory

我本来希望raw.png和clip2txt.exe是二进制文件而被忽略。文件测试将正确转换,这很好。

我在这里错过了什么吗?
谢谢你,
亚历克斯

最佳答案

如果有人在调查,我将其标记为已回答:

解决方案是将.gitattributes设置为

* text=auto eol=lf

感谢@phd

关于windows - git-强制lf行结尾不捕获二进制文件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53480627/

10-13 05:14