This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11005|Reply: 0

warning: LF will be replaced by CRLF in xxxx.

[Copy link]
Posted on 1/5/2021 11:26:06 AM | | | |
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 problem of symbolic escape

The line break in windows is CRLF, and the line break in linux is LF, so when performing add . Prompts, solution:


git core.autocrlf configuration instructions

Formatting is a minor headache that many developers encounter when collaborating, especially in cross-platform situations. Due to editor differences or Windows programmers adding line breaks to the end of file lines in cross-platform projects, some subtle space changes can inadvertently make their way into collaborative work or submitted patches. Don't worry, some configuration options for Git will help you solve these problems.

core.autocrlf

If you're writing a program on Windows, or if you're working with someone else who programs on Windows and you're on a different system, you may run into a line-ending closing issue. This is because Windows uses two characters, carriage enter and line breaks, to end a line, while Mac and Linux only use one character for line breaks. While this is a minor issue, it can greatly disrupt cross-platform collaboration.

Git can automatically convert line ender CRLF to LF when you commit, and LF to CRLF when you check out code. Use core.autocrlf to turn this on and set it to true on Windows, so that when the code is checked out, LF will be converted to CRLF.



Configure core.autocrlf to false, that is, do not enable the automatic conversion function.





Previous:SQL Server uses comma separating strings
Next:.NET/C# implements simple logging based on BlockingCollection
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com