Git submodule update

后端 未结 4 1932
Happy的楠姐
Happy的楠姐 2020-11-21 05:11

I\'m not clear on what the following means (from the Git submodule update documentation):

...will make the submodules HEAD be detached, unless -

4条回答
  •  轮回少年
    2020-11-21 06:10

    Git 1.8.2 features a new option ,--remote, that will enable exactly this behavior. Running

    git submodule update --rebase --remote
    

    will fetch the latest changes from upstream in each submodule, rebase them, and check out the latest revision of the submodule. As the documentation puts it:

    --remote

    This option is only valid for the update command. Instead of using the superproject’s recorded SHA-1 to update the submodule, use the status of the submodule’s remote-tracking branch.

    This is equivalent to running git pull in each submodule, which is generally exactly what you want.

    (This was copied from this answer.)

提交回复
热议问题