Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "none" mean in git ls-files --eol?

Tags:

git

What does the eolinfo "none" mean in the output of git ls-files --eol. The documentation at git-scm.com does not explain. Example:

i/none  w/none  attr/text=auto eol=crlf myfile.bat
i/lf    w/crlf  attr/text=auto eol=crlf myotherfile.bat

Does "none" mean Git cannot identify file content? Or does it mean there is neither CRLF nor LF in the file? For instance, the myfile.bat file above has only one line, and after putting cursor at end of text, it is still on the first line (at end of first line). So there is neither a CRLF nor an LF anywhere in the file?

I ask because neither of the .gitattributes settings below (both the one now commented out and the second attempt below it), where I attempted to make .bat files have CRLF on checkout, had any affect on some files like myfile.bat.

* text=auto
# *.bat eol=crlf
*.bat text eol=crlf

Please no comments about using instead git config core.autocrlf or similar, unless it bears on this use of .gitattributes (e.g., a settings conflict scenario). I'm already aware of the git config setting.

like image 699
Stephen Frost Avatar asked Apr 23 '26 17:04

Stephen Frost


1 Answers

Yes, it indicates that the file has no end of line: it may be a binary file or it may be a text file of only one line with no eol character at the end of that line.

like image 102
mipadi Avatar answered Apr 25 '26 13:04

mipadi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!