根据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 会被忽略,因为它们是二进制文件。文件测试将被正确转换,那就好了。
我在这里错过了什么吗?` 谢谢你, br亚历克斯
最佳答案
如果有人正在研究这个问题,我会将其标记为已回答:
解决方案是将 .gitattributes 设置为
* text=auto eol=lf
感谢@phd
关于windows - git - 强制 lf 行结尾不捕获二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53480627/