git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Clone repositories recursive with depth 1
@ 2015-11-11 14:09 Lars Schneider
  2015-11-11 19:19 ` Stefan Beller
  2015-11-14 16:25 ` Fredrik Gustafsson
  0 siblings, 2 replies; 6+ messages in thread
From: Lars Schneider @ 2015-11-11 14:09 UTC (permalink / raw)
  To: Git List

Hi,

I have a clean build machine and I want to clone my source code to this machine while transferring only the minimal necessary amount of data. Therefore I use this command:

git clone --recursive --depth 1 --single-branch <url>

Apparently this does not clone the submodules with "--depth 1" (using Git 2.4.9). As a workaround I tried:

git clone --depth 1 --single-branch <url>
cd <repo-name>
git submodule update --init --recursive --depth 1

However, this does not work either as I get:
fatal: reference is not a tree: <correct sha1 of the submodule referenced by the main project>
Unable to checkout <correct sha1 of the submodule referenced by the main project> in submodule path <submodule path>

How would you clone the repo? Is the behavior above expected? If not, should the "--depth 1" flag be applied recursively to all submodules on a clone --recursive? Has a patch implementing this a chance to get in?

Thanks,
Lars

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-14 16:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-11 14:09 [RFC] Clone repositories recursive with depth 1 Lars Schneider
2015-11-11 19:19 ` Stefan Beller
2015-11-11 20:09   ` Stefan Beller
2015-11-12  9:39     ` Lars Schneider
2015-11-12 23:47       ` Stefan Beller
2015-11-14 16:25 ` Fredrik Gustafsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).