Git submodule init async

后端 未结 4 2312
清酒与你
清酒与你 2021-02-19 16:02

When I run git submodule update --init first time on a projects which have a lot of submodules, this usually take a lot of time, because most of submodules are stor

4条回答
  •  醉梦人生
    2021-02-19 16:55

    Update January 2016:

    With Git 2.8 (Q1 2016), you will be able to fetch submodules in parallel (!) with git fetch --recurse-submodules -j2.
    See "How to speed up / parallelize downloads of git submodules using git clone --recursive?"


    Original answer mid-2013

    You could try:

    • to initialize first all submodules:

      git submodule init

    Then, the foreach syntax:

    git submodule foreach git submodule update --recursive -- $path &
    

    If the '&' applies to the all line (instead of just the 'git submodule update --recursive -- $path' part), then you could call a script which would make the update in the background.

    git submodule foreach git_submodule_update
    

提交回复
热议问题