且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

文件过大无法git pull/git clone解决办法

更新时间:2022-01-29 23:43:18

由于公司无线限速, windows下拉代码会比较慢, 导致过大的仓库无法clone/pull下来, 可以尝试以下方法, 将一次拉取的size缩小, 然后再fetch


  1. 效率云中代码库过大时, 会有限制, 出现无法pull或者clone的情况, 如下图
    文件过大无法git pull/git clone解决办法


  2. 首先以shallow模式克隆

    例如: 
    git clone http://gaoyuan03_iwaimai.baidu.com_waimai@xiaolvyun.baidu.com/git/waimai/c_qa/tools --depth 1
    文件过大无法git pull/git clone解决办法

  3. 到当前repository路径下, git fetch --unshallow, 即可拉取成功
    文件过大无法git pull/git clone解决办法

    如果仓库实在过大, 本方法也会无效, 详细解决办法参考: 
    http://blog.csdn.net/menghuanbeike/article/details/74001756
    https://91tianlu.org/knowledgebase.php?action=displayarticle&id=7