LF'll is replaced by CRLF problem resolution

Source: Internet
Author: User

[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
    1. $ Rails New Blog

When you switch to the blog directory, execute

Ruby Code
    1. $ git init
    2. $ 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
    1. $ rm-rf. Git
    2. $ git config--gobal Core.autocrlf false

So that the system won't be able to convert the newline character.

Final re-execution

Ruby Code
    1. $ git init
    2. $ git Add.

The system will run properly!

LF'll is replaced by CRLF problem resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.