git repo gives contradictory info from WSL than from standard windows
The two git installations (native windows and WSL) are using a different setting for the core.autocrlf
configuration, because these two installations are not using the same global config file.
Put simply, the native windows client is converting LF to CRLF upon checkout, and hence the presence of CRLF is not "seen" as a change by git status
. On the contrary, the WSL client expects UNIX-style LF line endings, so the git status
sees every file as having been modified to change LF to CRLF.
Instead of relying on the global setting the core.autocrlf
you should set it locally in the repository for any shared repositories. If the same repository is being accessed from both Linux/WSL and native Windows, you probably want this set to false
so git does not change any line endings at all. Just beware that if you do set this as false, you'll have to make sure your editors can handle the line endings as they are (in general, most programmers editors I've used do support using UNIX LF, even on Windows).
The core.autocrlf
is documented here for more info:
https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration