fatal: CRLF would be replaced by LF

转自: http://toub.es/2012/05/28/fatal-crlf-would-be-replaced-lf

I remember it was a Friday, I wanted to commit my changes and go home to start a good weekend.

When I tried to add new files to my local git repository, I experienced this issue:

$> git add .
fatal: CRLF would be replaced by LF in /core/sites/all/modules/thirdlibrary/file.xyz

After researching a bit, I discovered that the problem was being caused by a third library included in my project and for some reason Git didn't want to include those files in my repository.

According to the inexhaustible knowledge of StackOverflow, here and also here explain the problem and how to solve it.

Commonly this issue is produced by how the end of line is treated on different operative systems. If you ever encounter this problem, I suggest you do the following:

1.- Install dos2unix. It's a DOS/MAC to UNIX and vice versa text file format converter.

$> sudo apt-get install dos2unix

2.- Check your files with dos2unix tool. Make sure that dos2unix checks all files on your conflictive folder. Those files who are ok, dos2unix will not change it.

$> find  /core/sites/all/modules -type f -exec dos2unix {} \;

The problem will be gone the next time you try to add your files to your git repository.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值