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

Re: git clone submodules recursive and reference

From
Samuel Maftoul <samuel.maftoul@gmail.com>
Date
Apr 20, 2012, 19:26 UTC
Message-ID
<CAFj+z04A5v7Cz=Wbqn_TBJQG88rPSfrs4T1=22x1N+v77ZXgYA@mail.gmail.com>
In-Reply-To
<4F91B22A.9000507@web.de>
Show 5 quoted lines
> Hmm, to me it looks like passing the --reference option to the clone
> run in the submodules doesn't make much sense, as that would make
> all submodules and the superproject use the same alternates. And as
> far as I know sharing objects between different repositories is not
> supported.

I'm sharing objects between repositories by creating a bare repository, adding the remotes for the repositories and fetch them in this bare repo. So for me, it makes sense to pass the "--reference" to the submodules clone, if submodules remotes are added to this reference bare repo and objects are already fetched (and I'm in this case, as I use a lot of different projects that shares the same set of submodules).

Show 6 quoted lines
>
>> How can I force the clones for submodules to be executed with the
>> --reference option ?
>
> You'd have to use "git clone" without the --recursive option and
> then do a "git submodule update --init --reference ...".

Yes, this should make it, but I would have been more happy with a single command !

Thanks Jens !
Previous: Jens LehmannNext: Jens Lehmann
Message 3 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.