I am working on a project which uses both CRLF and LF line endings. I am working on windows.
git format-patch
. When I open this patch, it has correct LF line endings. The patch says the file is similar at 97% (only the line endings have been changed).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%.How is it possible to send a patch with LD line ending on windows? Thanks
Don't forget to add a .gitattributes
rule for that file, in order to force lf for that file
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)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.