I am learning to program cross-platform with java, git and eclipse. I read a lot about line endings but I am not sure exactly how to use what. The article of Tim Clem states it very simple: when core.eol
is set to native
, you get crlf in windows and lf in unix like environments and git translates between the two. That's what I want. However, this article asks me to set core.autocrlf true
. Another article asked me to set it to true
on windows and input
on linux. According to the man pages this overrides core.eol and I do not see the use of that. It adds an extra level of making mistakes.
Next one should start the .gitattributes
file with * text=auto
and define what exactly text is. What I have trouble to understand is that when the setting of core.eol native
seems to be satisfactory, why I should define autocrlf
or .gitattributes
? As far as I can see Git handles all the conversions and is clever enough to determine which file is text and which is binary. If I do not trust Git's decision making I may specify exactly which files are text and which not in .gitattributes
. But why should I define * auto true
when core.eol
is native
?
My question: if core.eol native
is insufficient for working cross platform, why is that the case? I am obviously missing some point, but I could not find it out reading the docs because different articles and man pages say different things. Any help will be greatly appreciated.