Easy way to pull latest of all git submodules

前端 未结 19 2027
谎友^
谎友^ 2020-11-22 05:20

We\'re using git submodules to manage a couple of large projects that have dependencies on many other libraries we\'ve developed. Each library is a separate repo brought int

19条回答
  •  暖寄归人
    2020-11-22 05:42

    Edit:

    In the comments was pointed out (by philfreo ) that the latest version is required. If there is any nested submodules that need to be in their latest version :

    git submodule foreach --recursive git pull
    

    -----Outdated comment below-----

    Isn't this the official way to do it ?

    git submodule update --init
    

    I use it every time. No problems so far.

    Edit:

    I just found that you can use:

    git submodule foreach --recursive git submodule update --init 
    

    Which will also recursively pull all of the submodules, i.e. dependancies.

提交回复
热议问题