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

Re: question about git-submodule

From
SVSven Verdoolaege <skimo@kotnet.org>
Date
Aug 5, 2007, 14:59 UTC
Message-ID
<20070805145922.GC999MdfPADPa@greensroom.kotnet.org>
In-Reply-To
<46B3B3D2.6030000@tromer.org>
On Fri, Aug 03, 2007 at 07:01:38PM -0400, Eran Tromer wrote:
> $ mkdir super
> $ cd super
> $ git init
> $ git submodule add ../sub-to-be sub

You probably don't want to do this as this URL probably won't work for anyone who wants to clone your superproject.

> BTW, is there any easy way to create a submodule directly inside the
> supermodule's working tree, instead of cloning it as in the above example?

Do you want to use the submodule porcelain or just the plumbing? If you simply want to add a submodule locally, "git add" will do that for you just fine. It's only when you want to make it easier for people who clone your superproject to get updates of the submodules that you should set up the information required by "git submodule" in .gitmodules (see end of module_add in git-submodule.sh).

Note that the "url" can be set directly in your git config (without specifying it in .gitmodules), but then anyone who clones from you will have to modify his config "manually" too. For some reason, the "path" element is required, even if it is equal to the submodule name.

skimo
Previous: Eran TromerNext: Eran Tromer
Message 21 of 22 in “question about git-submodule”
  1. VMiklosJul 13, 2007
  2. Sven VerdoolaegeJul 15, 2007
  3. Alex RiesenJul 15, 2007
  4. VMiklosJul 15, 2007
  5. Alex RiesenJul 15, 2007
  6. VMiklosJul 15, 2007
  7. Sven VerdoolaegeJul 15, 2007
  8. VMiklosJul 15, 2007
  9. Sven VerdoolaegeJul 15, 2007
  10. VMiklosJul 15, 2007
  11. Sven VerdoolaegeJul 15, 2007
  12. VMiklosJul 15, 2007
  13. Sven VerdoolaegeJul 15, 2007
  14. VMiklosJul 15, 2007
  15. Sven VerdoolaegeJul 16, 2007
  16. VMiklosJul 16, 2007
  17. Sven VerdoolaegeJul 15, 2007
  18. Alex RiesenJul 15, 2007
  19. Sven VerdoolaegeJul 15, 2007
  20. Eran TromerAug 3, 2007
  21. Sven VerdoolaegeAug 5, 2007
  22. Eran TromerAug 6, 2007

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.