git 提交报错 : The file will have its original line endings in your working directory.
报错现象
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.的更多相关文章
- 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 ...
- 解决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 ...
- 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 ...
- [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 ...
- 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 ...
- 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. 当报这个警告时是 ...
- 解决使用git出现 The file will have its original line endings in your working directory
执行以下命令即可解决 git rm -r --cached . git config core.autocrlf false git add . . 代表当前目录
- 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
- 解决 The file will have its original line endings in your working directory
首先出现这个问题主要原因是:我们从别人github地址上通过git clone下载下来,而又想git push到我们自己的github上,那么就会出现上面提示的错误信息 此时需要执行如下代码: git ...
随机推荐
- 【fetch跨域请求】cors
当使用fetch 发起跨域请求时,CORS(跨域资源共享Cross-origin resource sharing) 请求fetch const body = {name:"Good boy ...
- H5 字体属性补充
04-字体属性补充 abc我是段落 <!DOCTYPE html> <html lang="en"> <head> <meta chars ...
- springmvc的@ResponseBody报错
错误:差不多就是下面的格式 原因:你可能返回的类型是这样的List<School>而school类中可能包含Class类或者Teacher类,就是包含对象. 这样的话jackson是不能帮 ...
- pycharm导入自己写的.py文件时,模块下方出现红色波浪线解决
点击菜单栏的File,选择Setting, 然后,选择需要导入的.py文件“所在的目录",而非项目根目录,右键 之后再导入该.py文件就不会出现红色波浪线了.
- 抽象代数-p22商群
G/e={g{e}|g∈G}={{g}|g∈G}=G G/G={gG|g∈G}={G} (gG=G左乘g是G上的双射,它的逆映射是左乘g^-1) 所以 G/G 只有一个元素,所有G 就只能是 ...
- Python_动态参数、名称空间、作用域、作用域链、加载顺序、函数的嵌套、global、nonlocal
1.动态参数 当实参数量与形参数量相等时,参数传递正常. def func1(a, b, c): pass func1(1, 2, 3) 当实参数量与形参数量不相等时,则会报错. def func1( ...
- 自己实现数据结构系列五---BinarySearchTree
一.二分搜索树: 1.代码: public class BST<E extends Comparable<E>> { private class Node{ public E ...
- 【学习总结】Git学习-参考廖雪峰老师教程五-远程仓库
学习总结之Git学习-总 目录: 一.Git简介 二.安装Git 三.创建版本库 四.时光机穿梭 五.远程仓库 六.分支管理 七.标签管理 八.使用GitHub 九.使用码云 十.自定义Git 期末总 ...
- spring datasource jdbc 密码 加解密
spring datasource 密码加密后运行时解密的解决办法 - 一号门-程序员的工作,程序员的生活(java,python,delphi实战)http://www.yihaomen.com/a ...
- 分布式ID生成系统 UUID与雪花(snowflake)算法
Leaf——美团点评分布式ID生成系统 -https://tech.meituan.com/MT_Leaf.html 网游服务器中的GUID(唯一标识码)实现-基于snowflake算法-云栖社区-阿 ...