I’m sorry, but I just hate when Git is messing with my files… That’s just not its job!
warning: CRLF will be replaced by LF in …
The file will have its original line endings in your working directory.
To fix it on your computer, set
core.autocrlf to `
> git config --show-origin core.autocrlf
Then either edit the file manually, or do one of the following:
> git config --system core.autocrlf false
# User level (probably preferred)
> git config --global core.autocrlf false
# Repo level (no point, use .gitattributes instead)
> git config --local core.autocrlf false
Shared repository fix
For shared projects, others might not have set this or even want to set this, so to prevent issues there, creating a
.gitattributes file at the root of the repo with the following contents should fix things:
Source: How to express core.autocrlf = false with .gitattributes
For already messed up repos or working-copies, after changing
core.autocrlf, you might be able to renormalize the files one of the methods described in this answer on StackOverflow.