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

Re: Git-submodule questions

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Oct 19, 2007, 21:30 UTC
Message-ID
<alpine.LFD.0.999.0710191423130.26902@woody.linux-foundation.org>
In-Reply-To
<alpine.LFD.0.999.0710191420410.26902@woody.linux-foundation.org>
On Fri, 19 Oct 2007, Linus Torvalds wrote:
Show 9 quoted lines
> 
> In fact, it should be enough to do
> 
> 	cd /srv/DM
> 	git init
> 	git add .
> 	git commit
> 
> and you're now literally all done!
.. btw, when I say that, I guess I'm lying a bit.

Yes, the above will actually generate a valid git superproject repository, but it won't generate/populate the necessary .gitmodules stuff. You'd need to add it by hand.

But yes, if you want to avoid doing that hand-editing, you should use the whole "git submodule add .." thing to clone the git repos you already have into a supermodule. But the .gitmodules thing really is pretty simple, you just do something like

	[submodule "x"]
		path = x
		url = official-url-of-x
	[submodule "y"]
		path = y
		url = official-url-of-y

and now you just do "git submodule init" and you should be all done (again, the "git submodule init" thing you could do by hand by editing the .git/config file, but since you can do it automatically in-place, there's no real point).

		Linus
Previous: Linus Torvalds
Message 3 of 3 in “Git-submodule questions”
  1. Evan CarrollOct 19, 2007
  2. Linus TorvaldsOct 19, 2007
  3. Linus TorvaldsOct 19, 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.