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
Similar Posts:
- [git] warning: LF will be replaced by CRLF
- [How to Solve Error] warning: LF will be replaced by CRLF in README.md.
- Git Warning: LF will be replaced by CRLF | fatal: CRLF would be replaced by LF
- Conflict between git windows and MAC newline
- [git] warning: LF will be replaced by CRLF | fatal: CRLF would be replaced by LF
- On branch master nothing to commit, working tree clean ERROR: Repository not found. fatal: Could …
- [Solved] Expected linebreaks to be ‘LF’ but found ‘CRLF’.
- [Solved] git add Error: warning: LF will be replaced by CRLF in ……
- Git LS files displays the current file status
- Git diff indicates the change of FileMode (old mode 100644, new mode 10075)