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 ...
随机推荐
- Python-TXT文本操作
一.列出IO操作的标识符及描述 标识符 描述 r 以只读方式打开文件.文件的指针将会放在文件的开头.这是默认模式. rb 以二进制格式打开一个文件用于只读.文件指针将会放在文件的开头.这是默认模式. ...
- @RequestBody ajax 415 400
使用springmvc和Ajax进行数据交互时使用标签@RequestBody时我报了这两个错,刚开始对springmvc的使用和注解有点迷,然后踩坑上了. 先说下怎么才会踩上去.首先@Request ...
- ACM/ICPC 2018亚洲区预选赛北京赛站网络赛D-80 Days--------树状数组
题意就是说1-N个城市为一个环,最开始你手里有C块钱,问从1->N这些城市中,选择任意一个,然后按照顺序绕环一圈,进入每个城市会有a[i]元钱,出来每个城市会有b[i]个城市,问是否能保证经过每 ...
- Tea Party CodeForces - 808C (构造+贪心)
Polycarp invited all his friends to the tea party to celebrate the holiday. He has ncups, one for ea ...
- git的用法步骤讲解
1.创建全局的本地用户名 git config --global user.name "teamemory" git config --global user.email &quo ...
- 03-Linux的shell命令 .doc
快捷键 基本操作和命令 Cd转换文件夹 以/开头的是绝对路径 没有/相对路径 ../代表上一级目录 Tab补充 Ctrl+R 查找历史输入过的命令 箭头上也代表能够查询以往输入的命令 Ctrl+C 终 ...
- 使用jmeter来发送json/gzip格式数据 --------笔记
一.使用jmeter来发送gzip数据 有时候我们需要模拟在客户端将数据压缩后, 发送(post)到服务器端. 通常这种情况,会发生在移动终端上. 这样做的好处, 是可以节省流量. 当然, 服务器返 ...
- jmeter环境配置
Java 8 安装 正常安装,一路默认就好,记住安装路径,配置环境变量时用得到.默认安装路径:C:\Program Files\Java\jdk1.8.0_91. 安装好之后会有两个文件夹一个是jdk ...
- 《Effective C++》让自己习惯C++:条款1-条款4
条款1:视C++为一个语言联邦 可以将C++分为4个层次: 1.C:C++实在C语言的基础上发展而来的. 2:Object-Oriented C++:C++面向对象. 3:Template C++:C ...
- Mybatis 配置resultMap一对多关联映射
resultMap配置: 引用: PO类: 接口: 测试: public class UserMapperTest { private SqlSessionFactory sqlSessionFact ...