您好,我有一个包含子模块的超级项目。子模块通过分支名称而不是 sha 提交号进行跟踪。在我们的构建服务器上,我想尽可能少地拉动。所以我尝试了
git submodule update --remote --init
Run Code Online (Sandbox Code Playgroud)
然而这并不肤浅。似乎拉出所有内容然后切换到分支
git submodule update --remote --init --depth 1
Run Code Online (Sandbox Code Playgroud)
这不起作用,它失败了:
git submodule update --remote --init --depth 1 ThirdParty/protobuf
Submodule 'ThirdParty/protobuf' (ssh://myrepo/thirdparty/protobuf.git)
registered for path 'ThirdParty/protobuf'
Cloning into '/home/martin/jenkins/workspace/test_log_service/repo/ThirdParty/protobuf'...
fatal: Needed a single revision
Unable to find current origin/version/3.2.0-era revision in submodule path 'ThirdParty/protobuf'
Run Code Online (Sandbox Code Playgroud)
关于浅层子模块有一个不同的问题,但是我不认为它适用于分支,仅适用于 sha 提交