Git prompt appears as shown when editing the file to add:
The reason: CRLF - Carriage-Return Line-Feed line breaks
Solution:
Git provides a newline check function ( core.safecrlf
), you can check whether a file mix of different styles of line breaks at the time of submission. This feature options are as follows:
false - do not do any checking
warn - checks and warned at the time of submission
true - check at the time of submission, if you refuse to submit to mix found
We recommend using the most stringent true
option.
(1) If you're a Windows programmer, and is developing a project run only on Windows, you can set false
to cancel this function, the carriage returns recorded in the repository: $ git config - , Ltd. Free Join Core . Autocrlf false
(2) Linux or Mac systems use LF as a line terminator, so you do not want Git to automatically convert the files checked out; when a character line to end with a CRLF file was accidentally introduced you definitely want to be corrected,
The core.autocrlf
set input to tell Git to convert CRLF when submitting to LF, not converted when you check out: $ git config - , Ltd. Free Join Core . Autocrlf input
(3) Git automatically converts the line terminator CRLF to LF when you commit, and in the code checked out to convert LF CRLF. Use core.autocrlf
to open this feature, if it is on a Windows system,
It is arranged true
so that when the code checked out, will be converted to the LF CRLF: $ config Git - Global Core . Autocrlf to true
Get!