GIT拉取远程仓库地址报错处理方式

git拉取失败:curl 18 transfer closed with outstanding read data remaining错的解决方案

具体解决方案如下:

1. 一种是增大缓存区:

git config --global http.postBuffer 2097152000

2. 二是浅克隆,也就是说克隆的时候,先少克隆一些,比如只克隆每个文件只取最近一次提交,不是整个历史版本:

少clone一些,–depth 1

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

git clone https://github.com/仓库地址.git --depth 1

-----------------------------------------------------------------------

git clone --depth=1 后获取其他分支

$ git remote set-branches origin 'remote_branch_name'
$ git fetch --depth 1 origin remote_branch_name
$ git checkout remote_branch_name

3. 三是换协议:

clone http方式换成SSH的方式,
即 https:// 改为 git://

4. 四是更换网络:

主要拉取时间过长还给网速有关,尝试切换网速快的网络

5. 下载zip成功,尝试关联远程仓库:

创建本地仓库-建立对应关系-添加下载的项目到本地仓库-提交到本地仓库-推送到远程建立连接(推送失败,先pull,在push)

git init
git remote add origin + // 远程仓库地址
git add .
git commit -m '注释'
git pull origin master //master分支本地与远程对应
git push -u origin master
//可以新建分支,推送到新建分支上
git branch [name]
git push -u origin [name]

参考地址:

1. (6条消息) git拉取失败:curl 18 transfer closed with outstanding read data remaining错的解决方案_kangfu_521的博客-CSDN博客

2. git clone --depth=1 后获取其他分支 - 走看看 (zoukankan.com)

3. git clone --depth=1之后拉取其他分支 - 简书 (jianshu.com)

posted @ 2022-06-06 16:28  等风来灬  阅读(323)  评论(0编辑  收藏  举报