When submitting git records, I encountered a problem
fatal: LF would be replaced by CRLF
Reason :
Unix/Linux uses LF because of git line breaks, and Mac also uses LF later, but Windows has always used CRLF
Solution: Prohibit conversion of file formats, and secondly allow submission of files with newline characters
#禁止自动转换文件格式
git config --global core.autocrlf false
#允许提交包含混合换行符的文件
git config --global core.safecrlf false
Open the command line and execute the above two commands:
After execution, switch back to the git tool and submit. Here is sourcetree. From the figure below, you can see that all files can be submitted.
Finally, you need to restore the original state, execute the following command line. Avoid problems: When committing, the entire file is committed with changes, not the modified parts.