0


Git 仓库代码太大clone不下来

1. 问题

Git clone UE5 源码,由于源码太大,重复几次都是失败

2. Error Log

当 Git clone 代码到最后出现 fetch-pack: unexpected disconnect while reading sideband

fetch-pack: unexpected disconnect while reading sideband packet fatal: early EOF fatal: fetch-pack: 

packet fatal: early 时,大多是因为仓库代码太大,无法一次clone下来,这时需要如下操作:

解决办法

  1. 克隆最新一次提交
git clone --depth 1 https://github.com/dogescript/xxxxxxx.git
  • –depth 用来指定克隆的深度,
  • 1表示克隆最近的一次commit。
  1. 拉取完整当前分支,但是这里有个问题,不会把远程的所有分支拉取下来,那拉取所有分支怎么做呢?请看3
git fetch --unshallow
  1. 修改.git文件夹内config文件的[remote “origin”]节的内容
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
  1. clone所有分支
git fetch -pv
git fetch --all
标签: git

本文转载自: https://blog.csdn.net/weixin_44070137/article/details/132658357
版权归原作者 yblackd 所有, 如有侵权,请联系我们删除。

“Git 仓库代码太大clone不下来”的评论:

还没有评论