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就可以拉下其他分支

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章