报错现象

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. H5 67-清除浮动方式三

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. Spectral Bounds for Sparse PCA: Exact and Greedy Algorithms[贪婪算法选特征]

    目录 概括 Sparse PCA Formulation 非常普遍的问题 Optimality Conditions Eigenvalue Bounds 算法 代码 概括 这篇论文,不像以往的那些论文 ...

  3. Python_字符串初识及操作

    字符串初识及操作 str  'alex'.'1235443543'.'[1,2,3]'.可存放少量数据. 索引.切片.步长 索引编号 正向索引 'python' 012345 'p'的正向索引编号为0 ...

  4. 设置永久环境变量linux

    ========================================================================== http://www.cnblogs.com/Bi ...

  5. python3 操作页面上各种元素的方法

    (1)       控制浏览器 ①控制浏览器窗口大小set_window_size(宽,高) 打开浏览器全屏maximize_window() ②控制浏览器后退back().前进forward() ③ ...

  6. 为什么说Java中只有值传递(转载)

    出处:https://www.hollischuang.com/archives/2275 关于这个问题,在StackOverflow上也引发过广泛的讨论,看来很多程序员对于这个问题的理解都不尽相同, ...

  7. [转帖]nginx配置ssl加密(单/双向认证、部分https)

    nginx配置ssl加密(单/双向认证.部分https) https://segmentfault.com/a/1190000002866627   nginx下配置ssl本来是很简单的,无论是去认证 ...

  8. js怎么能取得多选下拉框选中的多个值?

    方法:获取多选下拉框对象数组→循环判断option选项的selected属性(true为选中,false为未选中)→使用value属性取出选中项的值.实例演示如下: 1.HTML结构 1 2 3 4 ...

  9. vue+webpack项目打包后背景图片加载不出来问题解决

    在做VUE +的WebPack脚手架项目打包完成后,在IIS服务器上运行发现项目中的背景图片加载不出来检查项目代码发现是因为CSS文件中,背景图片引用的路径问题;后来通过修改配置文件,问题终于解决了, ...

  10. @PathVariable

    @PathVariable是用来对指定请求的URL路径里面的变量 eg: Java代码 @RequestMapping(value = "form/{id}/apply", met ...