git commit致命错误“致命:CRLF将被替换为LF in” [英] git commit get fatal error "fatal: CRLF would be replaced by LF in"

查看:1129
本文介绍了git commit致命错误“致命:CRLF将被替换为LF in”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Ubuntu 13.10 x64,我正在开发一些项目,有些开发人员正在使用Windows,我最近将git config core.eol 更改为lf 和> core.autocrlf 改为输入并且 core.safecrlf 改为true。从那时起,当我尝试将文件提交到本地存储库时,出现以下错误:
致命:CRLF将被LF中的......替代

据我所知,如果我将 core.eol 设置为lf和核心。 autocrlf 改为input,git会自动将CRLF转换为LF,但为什么会出现这个错误?如何解决这个问题?



谢谢。 这是一个经典问题:



(图片来自 Luis Tubes 博客文章



通常的解决方法是自己将这些文件转换为 dos2unix 瑞士文件刀。 p>

我一直倾向于保留 core.autocrlf code>至 false ,这意味着:

  git config --global core.autocrlf false 


I'm using Ubuntu 13.10 x64, and I am working on a project that some developers are using Windows , I recently changed the git config core.eol to "lf" and core.autocrlf to "input" and core.safecrlf to "true". Since then, when I try to commit file into my local repository, I get this error:
fatal: CRLF would be replaced by LF in ......
From what I understand, if I set core.eol to "lf" and core.autocrlf to "input", git will automatically convert CRLF to LF, but why this error come out? How can I fix this problem?

Thank you.

解决方案

This is a classic issue:


(picture from Luis Tubes's blog post)

The usual fix is to convert those files yourself, with dos2unix or Swiss File Knife.

I have always preferred to keep core.autocrlf to false, which means:

git config --global core.autocrlf false

这篇关于git commit致命错误“致命:CRLF将被替换为LF in”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆