[GIT] warning:lf'll be a replaced by CRLF problem resolution
Development environment:
Operating system: Windows XP
Ruby 1.9.2
Rails 3.1.3
git version 1.7.8.msysgit.0
Problem Description:
Start git:
A new Rails project was created
Ruby Code
- $ Rails New Blog
When you switch to the blog directory, execute
Ruby Code
- $ git init
- $ git Add.
The system appears with the following error: Warning:lf'll be replaced by CRLF
Cause Analysis:
CRLF--Carriage-return line-feed return to line
is the carriage return (CR, ASCII, \ r) newline (LF, ASCII, \ n).
These two acsii characters do not have any output on the screen, but are widely used in Windows to identify the end of a line. In the Linux/unix system, there are only line breaks.
That is, the line break in Windows is CRLF, and the newline character under Linux is: LF
After using git to generate a rails project, the newline character in the file is LF, and when you execute git Add, the system prompts: LF will be converted to CRLF
Workaround:
Delete the. git file that you just generated
Ruby Code
- $ rm-rf. Git
- $ git config--gobal Core.autocrlf false
So that the system won't be able to convert the newline character.
Final re-execution
Ruby Code
- $ git init
- $ git Add.
The system will run properly!
LF'll is replaced by CRLF problem resolution