git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
amoblin
V2EX  ›  git

git clone 太慢怎么办?

  •  1
     
  •   amoblin · May 11, 2014 · 43661 views
    This topic created in 4571 days ago, the information mentioned may be changed or developed.
    git clone [email protected]:atom/atom.git
    Cloning into 'atom'...
    remote: Reusing existing pack: 98902, done.
    Receiving objects: 5% (5661/98902), 1.02 MiB | 8.00 KiB/s

    这么慢的速度怎么办好呢?

    clone了2次,由于网络问题中断了,然后就重新clone。git clone也不能断点续传。

    要不哪位v友贡献一个迅雷种子?
    Supplement 1  ·  May 12, 2014
    在各位v友的帮助下,atom终于完整clone!
    百度盘下载链接:http://pan.baidu.com/s/1EiqL4

    步骤如下:

    1. clone最新一个提交

    ```
    $ git clone --depth=1 [email protected]:atom/atom.git
    Cloning into 'atom'...
    remote: Counting objects: 444, done.
    remote: Compressing objects: 100% (359/359), done.
    remote: Total 444 (delta 20), reused 264 (delta 8)
    Receiving objects: 100% (444/444), 2.25 MiB | 7.00 KiB/s, done.
    Resolving deltas: 100% (20/20), done.
    Checking connectivity... done.
    ```

    2. 更新获取完整历史版本
    ```
    $ git fetch --unshallow
    remote: Counting objects: 98400, done.
    remote: Compressing objects: 100% (27919/27919), done.
    remote: Total 98159 (delta 68929), reused 97823 (delta 68611)
    Receiving objects: 100% (98159/98159), 236.07 MiB | 18.00 KiB/s, done.
    Resolving deltas: 100% (68929/68929), completed with 175 local objects.
    From github.com:atom/atom
    dbe15f7..7cdaaf2 master -> origin/master
    remote: Counting objects: 7, done.
    remote: Compressing objects: 100% (7/7), done.
    remote: Total 7 (delta 0), reused 7 (delta 0)
    Unpacking objects: 100% (7/7), done.
    * [new tag] v0.0.1 -> v0.0.1
    * [new tag] v0.0.2 -> v0.0.2
    ...此处省略91行
    * [new tag] v0.92.0 -> v0.92.0
    * [new tag] v0.93.0 -> v0.93.0
    * [new tag] v0.94.0 -> v0.94.0
    ```

    期间也中断过,和直接clone一样,都不支持续传。

    下面的事实可以说明我这里速度有多慢:
    unshallow后git status一看:
    ```
    $ git st
    On branch master
    Your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.
    (use "git pull" to update your local branch)

    nothing to commit, working directory clean
    ```

    ----分割线------


    使用https的速度比ssh协议的速度快,至少快2倍。不知为何?

    使用gitconfig的https proxy速度并未有显著提升,看来瓶颈还是在本身的网络环境。

    @wenLiangcan 没看懂怎么使用

    @582033 @sandtears proxychains未安装成功,貌似不在Homebrew官方Formula里?

    proxychains官方最新版是3.1版吗?github上还有一个4.2.0版本,还有一个ng版(next generation),好混乱...
    32 replies  •  2023-02-02 15:45:05 +08:00
    Sam
    Sam
    May 11, 2014❤️2
    1
    1. 加一个 --depth=1
    2. 登录到海外VPS git clone 然后 tar zcf :D
    guchengf
    guchengf
    May 11, 2014
    2
    download zip 也不行吗?
    likaci
    likaci
    May 11, 2014
    3
    哈哈哈,早上看见你在微博上抱怨了。
    shangjiyu
    shangjiyu
    May 11, 2014
    4
    最近是慢,,,
    pushy
    pushy
    May 11, 2014
    5
    这和迅雷种子有一毛钱关系 ??
    kehr
    kehr
    May 11, 2014
    6
    @amoblin 我也在弄,还没装好 ╮(╯▽╰)╭ 试了好几次了,龟速~

    ➜ Desktop > git clone https://github.com/atom/atom
    Cloning into 'atom'...
    remote: Reusing existing pack: 98902, done.
    Receiving objects: 25% (24828/98902), 10.49 MiB | 5 KiB/s


    @guchengf zip解压后编译了两次没成功,而且包比较小,不知什么原因。clone下来的项目能达到100M+,昨晚clone到90%,然后就再也没动过。

    今天Github宕机,又中断了几次~
    WildCat
    WildCat
    May 11, 2014
    7
    肉身翻墙是最优解
    amoblin
    amoblin
    OP
    May 11, 2014
    8
    @Sam --depth=1不错,只取最新的2个提交,库小了很多。据说最后可以通过git fetch --unshallow来获取完整库。 第二个方法我差点就这么干了 :)

    @guchengf download zip的只是最新分支的内容,不包含git库信息哦~

    @likaci :)
    kehr
    kehr
    May 11, 2014
    9
    看了--depth=1,突然反应过来了,知道为什么压缩包较小了。
    amoblin
    amoblin
    OP
    May 11, 2014
    10
    @kehr git clone --depth=1然后很快就下载完啦~ 现在git fetch --unshallow中,不知道这个支持断点不
    JoyNeop
    JoyNeop
    May 11, 2014
    11
    移民
    treo
    treo
    May 11, 2014
    12
    ss + proxychains
    hourui
    hourui
    May 11, 2014❤️1
    13
    ~/.gitconfig
    [http]
    proxy = sock5://127.0.0.1:7070

    配个ssh tunnel或者shadowsocks
    wwqgtxx
    wwqgtxx
    May 11, 2014 via Android
    14
    @hourui 正解
    然后用https地址即可
    fkj
    fkj
    May 11, 2014
    15
    在美国VPS上clone然后打包回来再chmod一下就好了。
    gsanidt
    gsanidt
    May 11, 2014
    16
    简单来说曲径通幽,复杂点就是肉身翻墙
    wenLiangcan
    wenLiangcan
    May 11, 2014
    17
    之前用这个
    https://caurea.org/2012/01/28/git-bundler-service-received-some-love.html

    不过现在没提供服务了,有谁有条件搭建个就好了
    notcome
    notcome
    May 11, 2014 via iPhone
    18
    13L 正解,改 libcurl config 也行
    gerorim
    gerorim
    May 11, 2014
    19
    i.imgur.com/svRQ5HV.png

    要在下分享给你一份?

    gero [dot] rim [at] gmail [dot] com
    gerorim
    gerorim
    May 11, 2014
    20
    XXOO
    XXOO
    May 11, 2014
    21
    @gerorim 这是 ubuntu?
    catoncat
    catoncat
    May 12, 2014
    22
    看到标题我就猜到是 atom 了。。。
    最后我是用 apt-get 安装成功的。
    http://www.webupd8.org/2014/05/install-atom-text-editor-in-ubuntu-via-ppa.html
    gerorim
    gerorim
    May 12, 2014 via Android
    23
    @XXOO

    Ubuntu 14.04 LTS + Tmux + ohMyZSH +powerLine
    palytoxin
    palytoxin
    May 12, 2014 via iPhone
    24
    学习了
    simapple
    simapple
    May 12, 2014
    25
    应该是连github慢吧 proxy 一下就快了
    582033
    582033
    May 12, 2014
    26
    @amoblin proxychains,楼主会喜欢的
    loryyang
    loryyang
    May 12, 2014
    27
    vpn就好了,现在没有vpn,日子太难过了,各种蜗牛
    Actrace
    Actrace
    May 12, 2014
    28
    试试powerpac?
    github在部分地区神速,在部分地区龟速.似乎取决于宽带运营商?
    sandtears
    sandtears
    May 12, 2014
    29
    有一款名为 proxychains 的软件,可以在命令行针对某一个命令进行代理
    heaventear
    heaventear
    Mar 18, 2017
    30
    挂个梯子,比如天路加速器, 看教程 https://91tianlu.com/knowledgebase.php?action=displayarticle&id=7
    heaventear
    heaventear
    Apr 8, 2017
    31
    其实原因是 git clone 慢,一劳永逸的解决办法是挂个加速器,教程在这里 https://91tianlu.cn/knowledgebase.php?action=displayarticle&id=7
    rokaiyataba
    rokaiyataba
    Feb 2, 2023
    32
    码农要自备工具啊,可以去看看天路云的教程,写的比较详细,对码农很有帮助,加速效果明显。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1872 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 09:51 · PVG 17:51 · LAX 01:51 · JFK 04:51
    ♥ Do have faith in what you're doing.