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

Time:08-17

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.

CodePudding user response:

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.

  •  Tags:  
  • git
  • Related