Based on this post: What is the purpose of `text=auto` in `.gitattributes` file? line endings are converted to LF for text files if you have the following in the .gitattributes file:
* text=auto
I just tested this on a local repository:
$ git add -A
warning: LF will be replaced by CRLF in [bla]/.gitattributes.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in [bla]/.gitignore.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in [bla]/README.md.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in [bla].csproj.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in
But there it says the it will convert to CRLF. In the post above it says it will convert to LF which is not the case in this test.
So it seems that:
* text=auto
will be converting to the line ending type based on the OS (CRLF for windows and LF for linux). But that is not what is being described here:
https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
Based on below comments/answers it seems that the warning resulting from having this:
* text=auto
in the .gitattributes file:
warning: LF will be replaced by CRLF in [bla]/README.md.
The file will have its original line endings in your working directory.
Actually means that when you do a check-out (next time you checkout a file from the repository to you working directory) text files currently with LF endings will be converted to have CRLF.
The warning does NOT address that on check-in lines will have LF endings which is what the documentation says here:
https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
Set to string value "auto" When text is set to "auto", the path is marked for automatic end-of-line normalization. If Git decides that the content is text, its line endings are normalized to LF on checkin.