zoukankan      html  css  js  c++  java
  • git LF 和 CRLF换行的问题

    错误提示:

    warning: LF will be replaced by CRLF in xxx The file will have its original line endings in your working directory

    image-20200605121205849

    注解:

    LF:Line Feed 换行

    CRLF:Carriage Return Line Feed 回车换行键

    1、不同操作系统下,处理行尾结束符的方法是不同的

      windows下:CRLF(表示句尾使用回车换行两个字符,即windows下的" "换行)

    ​ unix下:LF(表示句尾,只使用换行)

    ​ mac下:CR(表示只使用回车)

    2、Git下处理“换行”(line ending)

     core.autocrlf是git中负责处理line ending的变量,可以设置3个值:true,false,inout。

    (1)设置为true【config --global core.autocrlf true

    ​ 当设置成true时,这意味着你在任何时候添加(add)文件到git仓库时,git都会视为它是一个文本文件(text file)。

       它将把crlf变成LF。

    (2)设置为false【config --global core.autocrlf false

     当设置成false时,line endings将不做转换操作。文本文件保持原来的样子。

    (3)设置为input时,添加文件git仓库时,git把crlf编程lf。当有人Check代码时还是lf方式。因此在window操作系统下,不要使用这个设置。

  • 相关阅读:
    跨域资源共享 CORS 详解
    C# 每月第一天和最后一天
    jexus http to https
    ASP.NET MVC 路由学习
    jexus
    centos7 添加开机启动项
    jexus docker
    HTTP2.0新特性
    jexus配置支持Owin
    Autofac Named命名和Key Service服务
  • 原文地址:https://www.cnblogs.com/makalochen/p/13049289.html
Copyright © 2011-2022 走看看