[英]Git CRLF and LF line ending on windows/linux
I am working on a project which uses both CRLF and LF line endings.我正在开发一个同时使用 CRLF 和 LF 行尾的项目。 I am working on windows.
我正在研究 windows。
git format-patch
.git format-patch
。 When I open this patch, it has correct LF line endings.git send-email
.git send-email
将其发送给某人。 When I observe the mail sent with wireshark, all the line endings have been converted to CRLF.git show HEAD
, the file is said to be similar at 100%, even though the patch being applied said there should be a similarity of 97%.git show HEAD
时,据说该文件的相似度为 100%,即使应用的补丁说应该有 97% 的相似度。 How is it possible to send a patch with LD line ending on windows?如何发送以 windows 结尾的 LD 行的补丁? Thanks
谢谢
Don't forget to add a .gitattributes
rule for that file, in order to force lf for that file不要忘记为该文件添加
.gitattributes
规则,以便为该文件强制 lf
a_file text=auto eol=lf
But regarding your send-email issue, see " git am/format-patch
: control format of line endings ", try and use git send-email --transfer-encoding=base64
, to make sure everything is preserved (including eol)但是关于您的发送电子邮件问题,请参阅“
git am/format-patch
: control format of line endings ”,尝试使用git send-email --transfer-encoding=base64
,以确保一切都被保留(包括 eol)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.