Since git was exclusive to Linux at first, line breaks have always been LF in Linux. If a project team has Linux and Windows users, then the line breaks should be unified. Of course, general files should be unified as LF. After autocrlf is turned on, the local files of Windows users will still be CR LF, automatically converted to LF when submitted.
ps: Since Windows is widely used in China, it is very possible to change Windows-specific files to LF line breaks, such as bat batch scripts. In this way, the files downloaded from github will lose the CR line breaks, resulting in the inability to run.
This setting item is redundant. It is generally recommended to turn it off and manually ensure that the line breaks are consistent. Generally, current IDEs can display multiple line break styles normally, and LF can also be displayed normally under Windows. As long as you don't edit the code with Windows Notepad, there will be no CR LF style line breaks.
Um, are you using Baidu? . . So you don’t know the cause of the problem at all, it has nothing to do with automatic line wrapping
windows newline character: CRLF Linux/UNIX newline character: LF
So of course you need to convert the carriage return character from windows to UNIX.
Turn off line break conversion function
It works as follows:
Git can handle this by auto-converting CRLF line endings into LF when you add a file to the index
From the official documentation
Since git was exclusive to Linux at first, line breaks have always been LF in Linux. If a project team has Linux and Windows users, then the line breaks should be unified. Of course, general files should be unified as LF. After autocrlf is turned on, the local files of Windows users will still be CR LF, automatically converted to LF when submitted.
ps: Since Windows is widely used in China, it is very possible to change Windows-specific files to LF line breaks, such as bat batch scripts. In this way, the files downloaded from github will lose the CR line breaks, resulting in the inability to run.
This setting item is redundant. It is generally recommended to turn it off and manually ensure that the line breaks are consistent. Generally, current IDEs can display multiple line break styles normally, and LF can also be displayed normally under Windows. As long as you don't edit the code with Windows Notepad, there will be no CR LF style line breaks.