V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
justin2018

ssh: git clone 加速下载

  •  
  •   justin2018 · Dec 8, 2020 · 1245 views
    This topic created in 1967 days ago, the information mentioned may be changed or developed.

    这速度 理论上 clone 应该很快的 结果 clone 4kb/s 晕死了

    RTECRA3

    来源: https://gist.github.com/chuyik/02d0d37a49edc162546441092efae6a1

    修改 ~/.ssh/config 文件(不存在则新建):
    
    # 必须是 github.com
    Host github.com
       HostName github.com
       User git
       # 走 HTTP 代理 我使用这个会报错 不知道为啥 端口改成你自己的
       # ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=8080
       # 走 socks5 代理 这个 ok 端口改成你自己的
       # ProxyCommand nc -v -x 127.0.0.1:1080 %h %p
    

    下载速度嗖嗖嗖的~

    VNHT60l

    9 replies    2020-12-10 09:34:39 +08:00
    no1xsyzy
        1
    no1xsyzy  
       Dec 8, 2020
    ssh 链接一般不能走 HTTP 代理吧……
    omph
        2
    omph  
       Dec 9, 2020
    有时用 gitee,支持导入 github 项目
    dingwen07
        3
    dingwen07  
       Dec 9, 2020 via iPhone
    TAP 网卡解忧愁
    justin2018
        4
    justin2018  
    OP
       Dec 9, 2020
    @no1xsyzy 嗯 之前用的 http 失败了 后来用的 socks5
    daiqiangbudainiu
        5
    daiqiangbudainiu  
       Dec 9, 2020
    我一直用的 https git clone,直接环境变量配代理就行了
    tiramice
        6
    tiramice  
       Dec 9, 2020
    proxychains4 git clone
    justin2018
        7
    justin2018  
    OP
       Dec 9, 2020
    @tiramice 这个真不错 ~~ 好多都可以代理~ 厉害
    JimmyTinsley
        8
    JimmyTinsley  
       Dec 9, 2020
    proxychains +1
    Reficul
        9
    Reficul  
       Dec 10, 2020
    @no1xsyzy http 代理也可以走 TCP 流量的,CONNECTION 方法保持长链接
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3061 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 15:07 · PVG 23:07 · LAX 08:07 · JFK 11:07
    ♥ Do have faith in what you're doing.