git clone 报错处理

新服务器 git clone php项目时报错
[root@10-10-5-60 php]# git clone http://xxx/xxx/php.git
Cloning into 'php'...
remote: Counting objects: 91687, done
remote: Finding sources: 100% (91687/91687)
error: RPC failed; result=18, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header

经查有如下两种方法
方法一:git config --global http.postBuffer 524288000
postBuffer 默认值较小的原因,需要进行以上配置

方法二:
git clone xxxx --depth 1 (本次使用该方法解决) 之后再git pull时不用再加--depth 1
git pull --depth 1(pull的时候可以使用)

posted @ 2020-12-10 16:08  戴红领巾的少年  阅读(455)  评论(0编辑  收藏  举报
感谢您的阅读,如果您觉得阅读本文对您有帮助,请点一下“推荐”按钮。本文欢迎各位转载,但是转载文章之后必须在文章页面中给出作者和原文连接