标题:[实践OK]Git在存二进制文件时git add rsynctimer 出现fatal: rsynctimer 中的 CRLF 将被 LF 替换无法提交的解决办法。 出处:向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除 时间:Fri, 10 Jan 2020 18:15:42 +0000 作者:jackxiang 地址:http://jackxiang.com/post/10404/ 内容: git add rsynctimer fatal: playbook/bc.qr.*.cn/files/rsynctimer 中的 CRLF 将被 LF 替换 注意顺序,别搞反了: cat .gitattributes * text eol=lf * binary 上面这样修改后,git diff *.yml也认为是binary,无法git diff,还得这样, 让.out是可执行程序,因为gcc hello.c -o hello.out 于是 .out是可执行的二进制文件得了,作如下修改,正确如下: * .out binary * text eol=lf diff it add playbook/bc.qr.*.cn/files/rsynctimer/rsynctimer.out fatal: playbook/bc.qr.*.cn/files/rsynctimer/rsynctimer.out 中的 CRLF 将被 LF 替换 git diff playbook/bc.qr.*.cn/bc_web.yml #正常git diff 以上实践来自:http://www.it1352.com/798609.html 更多配置上的原理:https://www.jianshu.com/p/2a46dfd3705a Generated by Jackxiang's Bo-blog 2.1.1 Release