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的时候可以使用)

原文地址:https://www.cnblogs.com/peng-zone/p/14115632.html