Easy way to pull latest of all git submodules

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

    Here is the command-line to pull from all of your git repositories whether they're or not submodules:

    ROOT=$(git rev-parse --show-toplevel 2> /dev/null)
    find "$ROOT" -name .git -type d -execdir git pull -v ';'
    

    If you running it in your top git repository, you can replace "$ROOT" into ..

提交回复
热议问题