I get this LF will be replaced by CRLF when using git-bash
Full error looks like this: "The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in force-app/....." I know I can turn it off, and I am sure I can change the behaviour, but what is the correct behaviour. Is this error ok before a salesforce deployment? Why getting warning: crlf will be replaced by lf ?
This isn't an error, simply a warning that the files that will be committed are different than the files you saved. The default behavior for git on windows is to convert LF to CRLF, because some editors in Windows don't know how to handle LF (e.g. Notepad would ignore them and display everything as one line of text). The choice of line ending is a project preference. The most important part is that the line endings should all be consistent within the project, as a matter of not inconveniencing the developers working on it. Salesforce accepts any style of line ending, CR, LF, or CRLF, so you may choose whichever line ending style fits your development tools. It is perfectly okay to get this warning before a Salesforce deployment. Your deployment will not fail, nor will you be penalized for using CRLF instead of LF (e.g. your Apex Code Character Count still counts each line ending as only one character).