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