How do I git clone --recursive and checkout master on all submodules in a single line?

后端 未结 5 1057
失恋的感觉
失恋的感觉 2020-12-04 10:45

I really like this command to fetch a repo with submodules:

git clone git@github.com:my_user/my_repo.git --recursive

However, the submodule

5条回答
  •  忘掉有多难
    2020-12-04 11:21

    The question is why you checkout master. Your sub modules are pinned to a specific sha - that's also why the sub module clones are fixed to that specific commit. By not pointing to a specific sha an external repo could easily break your builds. Most definitely not what you want. Better update consciously. Builds should be reproducible and as fix as possible.

提交回复
热议问题