git clone公司的項目巍沙,遇到了三個問題
一盼理、fatal: The remote end hung up unexpectedly
這個錯誤净神,原因可能是網(wǎng)速慢竿报,文件大
可以嘗試以下措施:
- 將Http緩存設(shè)置大一些铅乡,比如1G:
git config --global http.postBuffer 1048576000
,或者3G3194304000
- 設(shè)置git最低速度
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
設(shè)置之后仰楚,fatal: The remote end hung up unexpectedly
這個錯誤沒有了隆判,又出現(xiàn)了新的錯誤
二犬庇、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
執(zhí)行git fetch --unshallow
時又報了錯誤侨嘀,再執(zhí)行一次git fetch --unshallow
就成功了臭挽,這個還不清楚怎么回事
項目下載下來了,但又有了新問題
三咬腕、只能看到master分支
現(xiàn)象是執(zhí)行git fetch
欢峰、git branch -a
都只能看到master
參考這篇文章,打開配置文件涨共,將
[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/*
然后執(zhí)行git fetch
就可以拉下其他分支了