Error reporting
This error is found when git add
Error analysis
Depending on the situation, it should be caused by the inadequate recognition of line feed by different systems
As far as common sense is concerned, the file is generated under windows, so the newline is really different from Linux, which may be caused by this
Error report solution
git config --global core.autocrlf false
In the same way, we should also do related operations in pychar
If you select fix and commit, it will be set to true and will be converted
So we have to choose commit as LS
Additional supplement
Line ending in Git
Core.autocrlf is the variable responsible for processing line ending in GIT. It can set three values: true, false and inout
(1) Set to true [config — global core. Autocrlftrue]
When set to true, this means that whenever you add a file to the GIT repository, GIT will treat it as a text file
It will turn CRLF into LF
(2) Set to false [config — global core. Autocrlffalse]
When set to false, line endings will not do conversion. The text file remains the same
(3) When it is set to input, GIT programs the CRLF to input when git repository is added. When someone checks the code, it’s still in LF mode. Therefore, in the window operating system, do not use this setting