报错现象

git  add . 的时候发现此报错

报错分析

看情况应该是不同系统对换行的识别不到位导致的

就常识来说文件是在windows下生成的所以换行和 linux 确实不同可能是因为这个导致的

报错解决

git config --global core.autocrlf false

同理在 pycharm 中也要做相关操作

在pycharm 中进行操作的时候也会提示这个问题. 如果选择 fix and commit 就会设置为 True 会被转换

所以我们要选择 commit as ls 不做处理

额外补充

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操作系统下,不要使用这个设置。

git 提交报错 : The file will have its original line endings in your working directory.的更多相关文章

  1. Git提交时提示‘The file will have its original line endings in your working directory’

    Git提交时提示'The file will have its original line endings in your working directory' Git出现错误 git add -A ...

  2. 解决git报错“The file will have its original line endings in your working directory”的方法

    在执行命令 git commit --all -m  '说明' 时报错“The file will have its original line endings in your working dir ...

  3. windows10下git报错warning: LF will be replaced by CRLF in readme.txt. The file will have its original line endings in your working directory.

    window10下使用git时 报错如下: $ git add readme.txtwarning: LF will be replaced by CRLF in readme.txt.The fil ...

  4. [Git add . ] 遇到The file will have its original line endings in your working directory 解决办法

    1.在新项目中使用[ git add . ]时出现: warning: LF will be replaced by CRLF in ...... The file will have its ori ...

  5. git出现“The file will have its original line endings in your working directory”错误

    一.现象: git add *时出现如下现象: The file will have its original line endings in your working directory 解决: G ...

  6. The file will have its original line endings in your working directory.

    在空仓库的情况下,add,出现一下问题 The file will have its original line endings in your working directory. 当报这个警告时是 ...

  7. 解决使用git出现 The file will have its original line endings in your working directory

    执行以下命令即可解决 git rm -r --cached . git config core.autocrlf false git add . . 代表当前目录

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

    git config --global core.autocrlf false

  9. 解决 The file will have its original line endings in your working directory

    首先出现这个问题主要原因是:我们从别人github地址上通过git clone下载下来,而又想git push到我们自己的github上,那么就会出现上面提示的错误信息 此时需要执行如下代码: git ...

随机推荐

  1. Leetcode 665. Non-decreasing Array(Easy)

    Given an array with n integers, your task is to check if it could become non-decreasing by modifying ...

  2. sqlserver2008 传入的表格格式数据流(tds)协议流不正确。

    起因是在sql 2008 里使用 sql prompt 报了一个内部连接致命错误,原本应该想到是数据库连接问题的,奇怪的是能连接上数据库也能查询表仅仅是用不了工具没有智能提示. 几经查询无果,度娘上之 ...

  3. 在IDEA中配置Spring的XML装配

    不考虑混合模式的话,Spring有三类装配Bean的方法,自动装配和Java代码装配都会很容易上手,但在弄XML装配时遇到了问题,这与IDEA环境有关. 装配时需要在源码中配置XML文件的位置,我看别 ...

  4. 最全的Django入门及常用配置

    Django 常用配置 Django 安装 pipx install django x 为python解释器版本2 or 3 如果你想安装指定版本的django,使用pip install djang ...

  5. ReentrantLock源码分析

    参考: 五月的仓颉 ReentrantLock实现原理 活在梦里 AQS源码解读 重入锁是基于AQS实现的,它提供了公平锁和非公平锁两个版本的实现. public class ReentrantLoc ...

  6. 【学习总结】Git学习-参考廖雪峰老师教程七-标签管理

    学习总结之Git学习-总 目录: 一.Git简介 二.安装Git 三.创建版本库 四.时光机穿梭 五.远程仓库 六.分支管理 七.标签管理 八.使用GitHub 九.使用码云 十.自定义Git 期末总 ...

  7. 搞站思路 <陆续完善中>

    只提供思路经验分享.不提供日站方法....一般站点那里最容易出现问题 入手思路: 主站一般都很安全.一般从二级域名下手 多看看那些大站新出来的测试分站点 猜路径别忘了google 考虑看站点下的rob ...

  8. spring aop学习记录

    许多AOP框架,比较常用的是Spring AOP 与AspectJ.这里主要学习的Spring AOP. 关于AOP 日志.事务.安全验证这些通用的.散步在系统各处的需要在实现业务逻辑时关注的事情称为 ...

  9. C#的类型推断发展史

    前言:随着C#的版本升级,C#编译器的类型推断功能也在不断的升级以适应语言进化过程中的变化,并为这个过程做了相应的优化. 隐式类型的数组 在C#1和C#2中,作为变量声明和初始化的一部分,初始化数组的 ...

  10. java8新特性:interface中的static方法和default方法

    java8中接口有两个新特性,一个是静态方法,一个是默认方法. static方法 java8中为接口新增了一项功能:定义一个或者多个静态方法. 定义用法和普通的static方法一样: public i ...