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

git submodule when submodule is not a clone of a repository

From
Sergio Callegari <sergio.callegari@gmail.com>
Date
Jan 18, 2008, 17:25 UTC
Message-ID
<loom.20080118T171433-93@post.gmane.org>
Hi,

I am trying to use submodules to keep a project organized. I am using a workflow that is probably not the common one and I am running into problems.

Basically, I have a superproject TOP, with subproject A and B. The thing is that A and B are _not_ cloned from some existing repo. They are two brand new repositories created with git init.

Basically, I am doing this so that in the superproject I commit states with specific versions of A and B (that are logically distinct things) that are known to work fine together. Also I am doing this since A and B are actually just started with TOP, but I have a provision of making them independently developed things, so I like to have them separated from start.

The thing is that git-submodule makes very strong assumptions on A and B. Particularly, if there is no url defined from them some commands (notably update) will fail.

So I need to make a fake url for the submodule (e.g. .) and a fake origin for it (again .)

Would it make sense to have a git submodule update not try to fetch if there is no url defined, but still checkout the right commit for the submodule (rather than skipping the submodule at all) ?

Sergio
Next: Lars Hjemli
Message 1 of 3 in “git submodule when submodule is not a clone of a repository”
  1. Sergio CallegariJan 18, 2008
  2. Lars HjemliJan 18, 2008
  3. Junio C HamanoJan 18, 2008

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.