git克隆review.opendev.org上项目出错

需要下载review.opendev.org上的项目。

首先需要一个该站账号,注册

克隆项目

[root@localhost /]# git clone "ssh://xxx@review.opendev.org:29418/openstack/project"
Cloning into 'project'...
remote: Counting objects: 3075, done
remote: Finding sources: 100% (66857/66857)
packet_write_wait: Connection to 199.204.45.33 port 29418: Broken pipe
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

 解决方法:原贴地址

方法一、修改git设置,

将Http缓存设置大一些,比如1G:git config --global http.postBuffer 1048576000,或者3G 3194304000

设置git最低速度

git config --global http.lowSpeedLimit 0

git config --global http.lowSpeedTime 999999

原错误没有了,可能会有新错误

方法二、

curl 18 transfer closed with outstanding read data remaining

error: RPC failed; curl 18 transfer closed with outstanding read data remaining

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

有文章说可能是tag资源太大引起的

可以尝试先浅拷贝,再fetch

git clone --depth=1 http://git地址

git fetch --unshallow

执行git fetch --unshallow时又报了错误,再执行一次git fetch --unshallow就成功了,这个还不清楚怎么回事

 方法三:

项目下载下来了,但又有了新问题

只能看到master分支

现象是执行git fetch、git branch -a都只能看到master

 

参考 ,打开配置项目下文件.git/config,将

[remote "origin"]

url = https://github.com/xxx/project.git

fetch = +refs/heads/master:refs/remotes/origin/master

修改为

[remote "origin"]

url = https://github.com/xxx/project.git

fetch = +refs/heads/*:refs/remotes/origin/*

然后执行git fetch就可以拉下其他分支

posted @ 2022-01-20 19:19  风中追风h  阅读(81)  评论(0编辑  收藏  举报