]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/clone.c
clone: add `--remote-submodules` flag
authorBen Avison <bavison@riscosopen.org>
Sun, 19 May 2019 14:26:49 +0000 (15:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 May 2019 16:22:02 +0000 (09:22 -0700)
commit4c6910163ab59f334becca39f5a83d3b7a622df4
treebb72bfb03d00e6a15e8187f02a5070fe6c8498ec
parentab15ad1a3b4b04a29415aef8c9afa2f64fc194a2
clone: add `--remote-submodules` flag

When using `git clone --recurse-submodules` there was previously no way to
pass a `--remote` switch to the implicit `git submodule update` command for
any use case where you want the submodules to be checked out on their
remote-tracking branch rather than with the SHA-1 recorded in the superproject.

This patch rectifies this situation. It actually passes `--no-fetch` to
`git submodule update` as well on the grounds they the submodule has only just
been cloned, so fetching from the remote again only serves to slow things down.

Signed-off-by: Ben Avison <bavison@riscosopen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-clone.txt
builtin/clone.c
t/t5617-clone-submodules-remote.sh [new file with mode: 0755]