Update Git submodule to latest commit on origin

后端 未结 14 1521
清歌不尽
清歌不尽 2020-11-27 09:02

I have a project with a Git submodule. It is from an ssh://... URL, and is on commit A. Commit B has been pushed to that URL, and I want the submodule to retrieve the commit

14条回答
  •  孤独总比滥情好
    2020-11-27 09:07

    Plain and simple, to fetch the submodules:

    git submodule update --init --recursive
    

    And now proceed updating them to the latest master branch (for example):

    git submodule foreach git pull origin master
    

提交回复
热议问题