1. 程式人生 > 其它 >git克隆review.opendev.org上專案出錯

git克隆review.opendev.org上專案出錯

需要下載review.opendev.org上的專案。

首先需要一個該站賬號,註冊

克隆專案

[root@localhost /]# git clone "ssh://[email protected]: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就可以拉下其他分支