git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git clone submodules recursive and reference

From
Samuel Maftoul <samuel.maftoul@gmail.com>
Date
Apr 20, 2012, 15:12 UTC
Message-ID
<CAFj+z055ZZc-Am+pEMgjRvHgoxKSRBjnHhABCseC45+8YswKWg@mail.gmail.com>
Hello,
I'm using git clone --reference, it works like a charm !

Now, I have submodules, so I call git clone with both --recursive and --reference, works only for the repo itself, submodules are being cloned without the "--reference" option.

With GIT_TRACE=1 I can see this for the initial repo:
trace: built-in: git 'clone' '--recursive' '--reference' [...]
And this for the submodules:
trace: built-in: git 'clone' '-n' [...]
for every submodules.
Is this an intended behavior ?

How can I force the clones for submodules to be executed with the --reference option ?

I tried to wrap /usr/lib/git-core/git-clone, but GIT_TRACE states it, it's a builtin and indeed my wrapped version of git clone is not executed !

Thanks
--
Samuel MAFTOUL
Next: Jens Lehmann
Message 1 of 7 in “git clone submodules recursive and reference”
  1. Samuel MaftoulApr 20, 2012
  2. Jens LehmannApr 20, 2012
  3. Samuel MaftoulApr 20, 2012
  4. Jens LehmannApr 21, 2012
  5. Samuel MaftoulApr 23, 2012
  6. Jens LehmannApr 23, 2012
  7. Phil HordJun 29, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.