warning: CRLF will be replaced by LF in Reasons and solutions

The
main reason for reprinting is that under different systems, the line breaks of files are represented by different characters.

Linux uses the newline character LF to indicate the next line;

Windows uses carriage return + line feed CRLF to indicate the next line;

Mac OS uses the carriage return CR to indicate the next line.

The solution is to switch the way git treats newlines.

git config core.autocrlf

Query the current response strategy.

When it is true, Git will treat all files you add as text and convert the ending CRLF to LF, and then convert the LF format of the file to CRLF format during checkout.

When it is false, the line endings will not be changed, and the text file will keep its original appearance.

When it is input, Git will convert CRLF to LF when adding, but it will still be LF when checking.

Use the following statement to make git ignore the judgment of the newline character.

git config core.autocrlf false

git config --global core.autocrlf false
git config --global core.filemode false
git config --global core.safecrlf true

Guess you like

Origin blog.csdn.net/weixin_43704402/article/details/113180604