Easy way to pull latest of all git submodules

前端 未结 19 1607
谎友^
谎友^ 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 06:02

    As it may happens that the default branch of your submodules is not master, this is how I automate the full Git submodules upgrades:

    git submodule init
    git submodule update
    git submodule foreach 'git fetch origin; git checkout $(git rev-parse --abbrev-ref HEAD); git reset --hard origin/$(git rev-parse --abbrev-ref HEAD); git submodule update --recursive; git clean -dfx'
    

提交回复
热议问题