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

git remote vs. submodules

From
PDPatrick Doyle <wpdster@gmail.com>
Date
Nov 11, 2010, 01:45 UTC
Message-ID
<AANLkTinev0W7-mm9wXmnZwY6DxN0Y2X0hJdpBOgM_4q=@mail.gmail.com>

Hello All, I was just reading about git remote and I started thinking to myself, "Gee, nothing I've read says that the remotes have to share a common ancestor. I wonder what would happen if I added two independent repositories as remotes to a superproject?"

So I tried it in a very trivial case. The first thing I learned was that I need to make the subprojects subdirectories of a top level .git-housing directory. Or else, when I merge them in, everything in the top level of subproject1 gets mixed in with everything in the top level of subproject2. So this doesn't seem to be a good solution for marrying arbitrary subprojects together. But if I set up a library of subprojects properly, it seems like I could do this.

So now I'm wondering... has anybody else ever had thoughts along these lines? Has anybody tried this? Has anybody seen it work (or fail miserably)?

Why would I want to do this instead of using submodules? I dunno. It just came to mind when I started trying to understand what's really going on with remotes. And I vaguely (and perhaps even correctly) recall there being some controversy regarding submodules when they were first introduced.

Anyway, I figured It wouldn't hurt to ask folks in the know.
--wpd
Next: Tomas Carnecky
Message 1 of 5 in “git remote vs. submodules”
  1. Patrick DoyleNov 11, 2010
  2. Tomas CarneckyNov 11, 2010
  3. Patrick DoyleNov 11, 2010
  4. Tomas CarneckyNov 11, 2010
  5. Patrick DoyleNov 11, 2010

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.