I'm working on a code repository where all developers collaborating with the repository using windows PC & eclipse as their IDE. The repository administrator has setup this .gitattributes file in the parent directory with the following:
* text eol=crlf
I read here that git internally maintains object database to write(commit)/read(checkout) the changes.
Does this above setting in .gitattributes will checkout the code with CRLF(windows) line ending and the file in the repository will be maintained in CRLF?
Enabled the "Show White Spaces" option in Eclipse IDE revealed that all the file endings were line feed(LF) without carriage return(CR).
Could someone point out the cause of this behavior?
On a different repository, It has
* text eol=lf
*.java eol=crlf
*.csv eol=crlf
*.jar binary
*.sql eol=crlf
Does this mean all files(.java/.csv/.sql) would have CRLF and other files would have LF line endings?
A good source for
.gitattributesinfo are the gitscm.com docs (https://git-scm.com/docs/gitattributes#__code_text_code)I do not believe
* text eol=crlfwill work. It should be* text crlfYou need to break the single line
* text eol=lf*.java eol=crlf*.csv eol=crlf*.jar binary*.sql eol=crlfinto the multiple lines.Add these lines to your
. gitattributesfile.