{"thread":{"id":"54225","subject":"Combine submodule and worktree with a center cache","startedAt":"2020-09-11T04:25:09Z","lastAt":"2020-09-19T19:15:47Z","messageCount":2,"participants":["gmail","Luke Diamand"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"405391","messageId":"8FA765EA-D06C-4569-9921-DC333809E2F7@gmail.com","threadId":"54225","inReplyTo":null,"subject":"Combine submodule and worktree with a center cache","fromName":"gmail","fromEmail":"coolnavy2010@gmail.com","sentAt":"2020-09-11T04:24:59Z","receivedAt":"2020-09-11T04:25:09Z","isPatch":false,"sender":{"key":"coolnavy2010@gmail.com","avatar":null},"body":"Hello, It is possible to combine submodule and worktree with a center cache like `$HOME/.git-modules` \nto speed up `git submodule update —init` and save disk space. Now I managed them manually. I suppose it will \nbe support by git automatically.\n\nBest wishes."},{"id":"405947","messageId":"CAE5ih7-S5_+LrFpRdjSHaXcg+GUsgiymcZUXCz6AJkW1-ksSWQ@mail.gmail.com","threadId":"54225","inReplyTo":"8FA765EA-D06C-4569-9921-DC333809E2F7@gmail.com","subject":"Re: Combine submodule and worktree with a center cache","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2020-09-19T19:15:33Z","receivedAt":"2020-09-19T19:15:47Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On Fri, 11 Sep 2020 at 05:25, gmail <coolnavy2010@gmail.com> wrote:\n>\n> Hello, It is possible to combine submodule and worktree with a center cache like `$HOME/.git-modules`\n> to speed up `git submodule update —init` and save disk space. Now I managed them manually. I suppose it will\n> be support by git automatically.\n\nI'm not exactly sure what you are trying to do but if you are doing this:\n\n    git clone --recurse-submodules git@some.server:myrepo\n    cd myrepo\n    git worktree add /path/to/worktree\n\nthen you can make the submodules part of the worktree go faster by\nusing the --reference option:\n\n    cd /path/to/worktree\n    git submodule update --reference /path/to/myrepo\n\nThat way the submodule syncs don't have to go back to the original\nserver to get the objects, they can get them from the local copy that\nyou've already got.\n\nHowever, I may have misunderstood what you are trying to do.\n\nLuke\n"}]}