Easy way to pull latest of all git submodules

前端 未结 19 1577
谎友^
谎友^ 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:58

    Henrik is on the right track. The 'foreach' command can execute any arbitrary shell script. Two options to pull the very latest might be,

    git submodule foreach git pull origin master
    

    and,

    git submodule foreach /path/to/some/cool/script.sh
    

    That will iterate through all initialized submodules and run the given commands.

提交回复
热议问题