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

Re: Combine submodule and worktree with a center cache

From
Luke Diamand <luke@diamand.org>
Date
Sep 19, 2020, 19:15 UTC
Message-ID
<CAE5ih7-S5_+LrFpRdjSHaXcg+GUsgiymcZUXCz6AJkW1-ksSWQ@mail.gmail.com>
In-Reply-To
<8FA765EA-D06C-4569-9921-DC333809E2F7@gmail.com>
On Fri, 11 Sep 2020 at 05:25, gmail <coolnavy2010@gmail.com> wrote:
>
> Hello, It is possible to combine submodule and worktree with a center cache like `$HOME/.git-modules`
> to speed up `git submodule update —init` and save disk space. Now I managed them manually. I suppose it will
> be support by git automatically.
I'm not exactly sure what you are trying to do but if you are doing this:
    git clone --recurse-submodules git@some.server:myrepo
    cd myrepo
    git worktree add /path/to/worktree

then you can make the submodules part of the worktree go faster by using the --reference option:

    cd /path/to/worktree
    git submodule update --reference /path/to/myrepo

That way the submodule syncs don't have to go back to the original server to get the objects, they can get them from the local copy that you've already got.

However, I may have misunderstood what you are trying to do.
Luke
Previous: gmail
Message 2 of 2 in “Combine submodule and worktree with a center cache”
  1. gmailSep 11, 2020
  2. Luke DiamandSep 19, 2020

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.