warning: CRLF will be replaced by LF in [filename]. The file will have its original line endings in your working directory.
Getting errors like these, and want to deliberately ignore them?
If you don’t know why you would, you should read this great blogpost about line endings in Git by Tim Clem.
In some cases you want to ignore these errors. In my specific situation i don’t want Git to warn me about the line endings, because my IDE takes care of that. I work in a project with multiple people, and somewhere in the process some files with different line endings than the project standard slipped into the repo. It happens. Your Git could be configured so that it automatically corrects the file line endings for you when you pull this code. And this can be pretty annoying.
You can change this behaviour, but again, to avoid problems you have to know the reason why you get these errors. Be sure you know, see the link earlier in this post.
You can disable the CRLF behaviour completely, or per filetype by changing entries in your .gitattributes file. In my case, i put this:
This tells git to ignore the line endings for all files. And does not change the files in your working directory. Even if you have the core.autocrlf set to true, false, or input.