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

Re: Submodule, subtree, or something else?

From
Stefan Beller <sbeller@google.com>
Date
Aug 24, 2015, 16:51 UTC
Message-ID
<CAGZ79kY+HLzd4esdy+i82Eh5Vhc1NEDDfinD2iiBMvV41GSCiw@mail.gmail.com>
In-Reply-To
<1440339066.32140.17.camel@gmail.com>
On Sun, Aug 23, 2015 at 7:11 AM, Jānis Rukšāns <janis.ruksans@gmail.com> wrote:
Show 22 quoted lines
> On Pk, 2015-08-21 at 17:07 -0700, Stefan Beller wrote:
>> On Fri, Aug 21, 2015 at 3:47 PM, Jānis Rukšāns <janis.ruksans@gmail.com> wrote:
>> >
>> > A major drawback of submodules in my opinion is the
>> > inability to make a full clone from an existing one without having
>> > access to the central repository, which is something I have to do from
>> > time to time.
>>
>> Can you elaborate on that a bit more?
>> git clone --recurse-submodules should do that no matter which remote
>> you contact?
>
> I mean that if I have cloned a repository with submodules, cloning that
> repository with --recurse-submodules will either access the "central
> server" if absolute URLs are used, or requires additional clones for
> each submodule.  For example
>
> git clone --recursive http://somewhere/projectA.git
> git clone --recursive file://$(pwd)/projectA projectA.tmp
>
> The second command will cause the submodules to be downloaded again, or
> expect them to be found in $(pwd).

IIUC, the second command will lookup the submodules in $(pwd), but if they are not there they are skipped, so all of the existing submodules are cloned. Why do you need more submodules in the tmp clone than in $(pwd)/projectA would be my next question. But I see your point now.

>
> Or am I mistaken, or doing something wrong?
>
Previous: Jānis RukšānsNext: Jānis Rukšāns
Message 4 of 6 in “Submodule, subtree, or something else?”
  1. Jānis RukšānsAug 21, 2015
  2. Stefan BellerAug 22, 2015
  3. Jānis RukšānsAug 23, 2015
  4. Stefan BellerAug 24, 2015
  5. Jānis RukšānsAug 24, 2015
  6. Jānis RukšānsAug 24, 2015

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.