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

git提交时出现该问题,百度了下发现好多答案:

有一个答案如下:

https://blog.csdn.net/yusufolu9/article/details/55096721

我最近使用了新的代码托管工具,把之前在oschina上的代码迁移到coding.net上去。提交代码时有一个文件提交失败。 
错误信息是 
LF will be replaced by CRLF in git -the file will have its original line endings,
The file will have its original line endings in your working directory.

查资料发现这是windows和mac系统的换行符不同导致的问题。windows使用CRLF 也就是回车换行,而mac使用LF单个换行。
git默认支持LF。windows commit代码时git会把CRLF转LF,update代码时LF换CRLF。
所以windows会有默认 core.autocrlf true 。
Mac 用户commit,update都用LF 所以 core.autocrlf input。

废话少说,怎么commit代码? 
简单,把报错的文件删了重新建相同文件粘贴代码就ok了

我思考了一下,我尼玛都没有用过mac啊,这是为什么呢?想了一下,可能是由于自己用的命令行工具的原因,之前用的是windows10自带的命令行工具,这次用的是git Bash命令行窗口,而git Bash八成是和mac系统一致。果然,我改为windows10自带的命令行工具即可。

引用:https://blog.csdn.net/yusufolu9/article/details/55096721

你可能感兴趣的:(GitHub)