美文网首页
Git 仓库代码太大clone不下来

Git 仓库代码太大clone不下来

作者: Mirsiter_魏 | 来源:发表于2022-03-30 16:05 被阅读0次

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

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

    第一步:

    git clone --depth 1 https://github.com/dogescript/xxxxxxx.git

    --depth 用来指定克隆的深度,1表示克隆最近的一次commit。

    第二步:

    git fetch --unshallow

    拉取完整当前分支,但是这里有个问题,不会把远程的所有分支拉取下来,那拉取所有分支怎么做呢?请看第三步

    第三步:

    git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"

    修改.git文件夹内config文件的[remote "origin"]节的内容

    第四步:

    git fetch -pv

    这时就能拉取所有的分支了

    第五步:

    git fetch --all

    相关文章

      网友评论

          本文标题:Git 仓库代码太大clone不下来

          本文链接:https://www.haomeiwen.com/subject/abqwjrtx.html