For a specific github repo ( only ) I need to make sure that all text files pushed have LF line-ending ( not CRLF ).
Further, pulled-down repo files should retain LF line-ending on clients either OSX or Windows.
Is this possible ?
For a specific github repo ( only ) I need to make sure that all text files pushed have LF line-ending ( not CRLF ).
Further, pulled-down repo files should retain LF line-ending on clients either OSX or Windows.
Is this possible ?
Try to add a file named .gitattributes
with the following contents:
* eol=lf
to your repo. Then no matter what settings for core.autocrlf
developers use, all the files will always use LF
.
Just keep in mind, that it will change CRLF
into LF
upon commit in binary files also (like zip, jar, png, etc.).
CRLF
to LF
in binary files means that it will corrupt them, possibly silently. That's not desirable at all... –
Diatribe *.txt eol=lf
, *.css eol=lf
. Silently? With git you cannot change a file silently - all will be seen with git status
. –
Fireworm some/dir/ binary
rule (to be placed in gitattributes
). It denotes all the contents of a directory as binary. Git will not apply any new line conversion to files under some/dir/
. –
Fireworm eol
in .gitattributes
. Here is an excerpt from git help attributes
: It enables end-of-line normalization without any content checks, effectively setting the text attribute. –
Fireworm You can't really control what your clients do - if they have core.autocrlf
set to true
then LF will get translated to CRLF automatically.
If everyone uses core.autocrlf = input
then it should all work fine.
© 2022 - 2024 — McMap. All rights reserved.