Git拉取报RPC&Bad Owner

报错信息

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
致命错误:无法访问 ' ' :transfer closed with outstanding read data remaining

描述

之前在从git远程库拉取项目的时候,出现了如上错误,因为拉取时间过长才报的错,所以猜测是内存或者项目过大导致的无法拉取,所以搜了搜,网上说是解决方案有三种,一种是增大缓存区;二是浅克隆,也就是说克隆的时候,先少克隆一些,比如只克隆每个文件只取最近一次提交,不是整个历史版本,三是换协议.

具体解决方案如下:

  1. 加大缓存区 git config –global http.postBuffer 524288000 这个大约是500M
git config --global http.postBuffer 1048576000

1048576000

  1. 少clone一些,–depth 1 git clone https://github.com/[flutter](https://so.csdn.net/so/search?q=flutter&spm=1001.2101.3001.7020)/flutter.git –depth 1

    git clone https://github.com/flutter/flutter.git --depth 1

    –depth 1的含义是复制深度为1,就是每个文件只取最近一次提交,不是整个历史版本。

  2. 换协议 clone http方式换成SSH的方式,

    即 https:// 改为 git://

    例如git clone https://github.com/test/test.git

    换成git clone git://github.com/test/test.git

报错信息

Bad owner or permissions on /Users/mukaikai/.ssh/config
fatal: Could not read from remote repository.

描述

当为本机配一个固定用户名远程登录某主机时,配置了一个config文件,但是在执行ssh免密码登录时报如下的错误:Bad owner or permissions on .ssh/config的解决。

解决方案

sudo chmod 600 ~/.ssh/config