|
warning: LF will be replaced by CRLF in xxxx. The file will have its original line endings in your working directory
The reason is that there is a symbol escaping problem
The line break character in windows is CRLF, while in linux it is LF, so there is a prompt when executing add . So there is a prompt when you execute add :
git core.autocrlf Configuration Notes
Formatting is a minor headache that many developers encounter when collaborating, especially in cross-platform situations. Due to differences in editors or Windows programmers adding carriage returns at the end of file lines in cross-platform projects, subtle space changes can inadvertently find their way into collaborative work or patch commits. Don't worry, Git has some configuration options that can help with this.
core.autocrlf
If you're writing a program on Windows, or if you're collaborating with other people who are programming on Windows while you're on another system, you may run into the end-of-line terminator problem in these cases. This is because Windows uses two characters, a carriage return and a line feed, to end a line, while Mac and Linux use only one character, the line feed. While this is a minor issue, it can greatly disrupt cross-platform collaboration.
Git can automatically convert the line terminator CRLF to LF when you commit, and LF to CRLF when you check out your code. turn this on with core.autocrlf, and if you're on Windows, set it to true so that LF is converted to CRLF when you check out your code.
Configure core.autocrlf to false, so that autoconversion is not turned on.
|
Previous: SQL Server use comma separated stringsNext article: NET/C# based BlockingCollection to achieve simple logging
|