V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
XiLemon
V2EX  ›  程序员

求助:怎样提高 Git 在 Windows10 上更新 submodule 的速度

  •  
  •   XiLemon · 2020-03-12 14:32:06 +08:00 · 2519 次点击
    这是一个创建于 1504 天前的主题,其中的信息可能已经有所发展或是发生改变。

    superproject 下面有个很多个管理 protobbuf 的 subproject,现在想要一次性更新所有的 subproject。

    更新命令:

    git submodule update --remote --merge --jobs 8
    

    MBP 上执行只需要一分半钟,Windows10 上面则需要十分钟( Git Bash 中执行的)。

    Git 版本:

    git version 2.21.1 (Apple Git-122.3)
    git version 2.24.1.windows.2
    

    MBP 的网络环境更差一点,毕竟要连 VPN。几次尝试下来,MBP 最多也不超过两分钟就能更新完。

    另外,更新之后执行 git status,Windows10 上也慢很多。

    11 条回复    2020-03-13 09:19:09 +08:00
    learningman
        1
    learningman  
       2020-03-12 15:39:33 +08:00   ❤️ 1
    你确定不是 git 没走代理吗。。。
    XiLemon
        2
    XiLemon  
    OP
       2020-03-12 16:03:00 +08:00
    @learningman #1 额,公司的项目,Windows10 在内网,MBP 在家里呢。。。
    Opportunity
        3
    Opportunity  
       2020-03-12 17:01:43 +08:00
    ·git status` 也慢的话,是不是应该考虑硬盘的问题了
    XiLemon
        4
    XiLemon  
    OP
       2020-03-12 17:23:47 +08:00
    @Opportunity Windows10 机器上的固态应该还没到退休的时候吧😂,看其他同事执行起来也挺慢的。。。
    MonoLogueChi
        5
    MonoLogueChi  
       2020-03-12 18:29:41 +08:00
    别用 git bash 试试看,用 powershell 或者 cmd,git bash 有的时候会有各种奇奇怪怪的问题,比如 commit 10 分钟还没跑完,git clone 没速度,这些我都遇到过
    XiLemon
        6
    XiLemon  
    OP
       2020-03-12 18:31:50 +08:00
    @MonoLogueChi 用的就是 Git Bash,PowerShell 没试过呢
    sikong31
        8
    sikong31  
       2020-03-12 19:49:59 +08:00
    git bash clone 的时候经常抽风,换 cmd/powershell 立马就好了
    hantsy
        9
    hantsy  
       2020-03-12 20:05:24 +08:00
    @sikong31 理论 Git bash 好些,毕竟 Git Windows 依赖 mingw64,不完全是原生的程序。
    XiLemon
        10
    XiLemon  
    OP
       2020-03-13 09:18:35 +08:00
    @maichael 谢谢,好像没啥用😂
    XiLemon
        11
    XiLemon  
    OP
       2020-03-13 09:19:09 +08:00
    @sikong31 CMD 也试过了,感觉更新 submodule 一样慢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1026 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:16 · PVG 04:16 · LAX 13:16 · JFK 16:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.