{"thread":{"id":"10383","subject":"Git-submodule questions","startedAt":"2007-10-19T20:54:51Z","lastAt":"2007-10-19T21:30:50Z","messageCount":3,"participants":["Evan Carroll","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"56630","messageId":"428b865e0710191354v59f558bbv4536d60902977ac@mail.gmail.com","threadId":"10383","inReplyTo":null,"subject":"Git-submodule questions","fromName":"Evan Carroll","fromEmail":"me@evancarroll.com","sentAt":"2007-10-19T20:54:51Z","receivedAt":"2007-10-19T20:54:51Z","isPatch":false,"sender":{"key":"me@evancarroll.com","avatar":"https://gravatar.com/avatar/44cedb04dbe5c62bab26e330a8aeedb79187aec5229fae55f24c852198519014?d=mp&s=160"},"body":"I've got a set of 5 git repositories on one computer. I'm looking for\na way to more cleanly distribute them, and keep them in sync when i\ndistribute them. I'm trying to discern whether the scantly documented\ngit-submodule can accomplish this...\n\nAll of my git modules are in one place, /srv/DM: /srv/DM/a ..\n/srv/DM/e to add them all into one super repository for easier\ndistributing I have to move them all to /srv/DM/git-old, then git init\nin /srv/DM, then I git submodule add all of the modules in\n/srv/DM/git-old. The question then comes down to why do I need to have\nmy git-submodules in /srv/DM, and /srv/DM/git-old.\n\nCan I make a superproject out of /srv/DM and just some how add all of\nthat directories contents as submodules. When I try to add them as\nlike that I just get submodule 'a' already exists (because it does as\na non-submodule but as a git-repos.)\n\nPicture a svn repository, now chop of the root, that's how my git\nlooks, and I'm trying to amend that. In svn all of your companies\nprojects can be tracked by one svn repository, not so in git. I'm\nwondering if submodule is or isn't the tool to deliver this\nfunctionality.\n\n-- \nEvan Carroll\nSystem Lord of the Internets\nme@evancarroll.com\n832-445-8877\n"},{"id":"56635","messageId":"alpine.LFD.0.999.0710191420410.26902@woody.linux-foundation.org","threadId":"10383","inReplyTo":"428b865e0710191354v59f558bbv4536d60902977ac@mail.gmail.com","subject":"Re: Git-submodule questions","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-10-19T21:22:48Z","receivedAt":"2007-10-19T21:22:48Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 19 Oct 2007, Evan Carroll wrote:\n>\n> I've got a set of 5 git repositories on one computer. I'm looking for\n> a way to more cleanly distribute them, and keep them in sync when i\n> distribute them. I'm trying to discern whether the scantly documented\n> git-submodule can accomplish this...\n\nSounds like subprojects are indeed a good way for you.\n\n> All of my git modules are in one place, /srv/DM: /srv/DM/a ..\n> /srv/DM/e to add them all into one super repository for easier\n> distributing I have to move them all to /srv/DM/git-old, then git init\n> in /srv/DM, then I git submodule add all of the modules in\n> /srv/DM/git-old. The question then comes down to why do I need to have\n> my git-submodules in /srv/DM, and /srv/DM/git-old.\n\nYou shouldn't need to do anything even half-way complicated like that.\n\nIn fact, it should be enough to do\n\n\tcd /srv/DM\n\tgit init\n\tgit add .\n\tgit commit\n\nand you're now literally all done!\n\n\t\tLinus\n"},{"id":"56636","messageId":"alpine.LFD.0.999.0710191423130.26902@woody.linux-foundation.org","threadId":"10383","inReplyTo":"alpine.LFD.0.999.0710191420410.26902@woody.linux-foundation.org","subject":"Re: Git-submodule questions","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-10-19T21:30:50Z","receivedAt":"2007-10-19T21:30:50Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 19 Oct 2007, Linus Torvalds wrote:\n> \n> In fact, it should be enough to do\n> \n> \tcd /srv/DM\n> \tgit init\n> \tgit add .\n> \tgit commit\n> \n> and you're now literally all done!\n\n.. btw, when I say that, I guess I'm lying a bit.\n\nYes, the above will actually generate a valid git superproject repository, \nbut it won't generate/populate the necessary .gitmodules stuff. You'd need \nto add it by hand.\n\nBut yes, if you want to avoid doing that hand-editing, you should use the \nwhole \"git submodule add ..\" thing to clone the git repos you already have \ninto a supermodule. But the .gitmodules thing really is pretty simple, you \njust do something like\n\n\t[submodule \"x\"]\n\t\tpath = x\n\t\turl = official-url-of-x\n\t[submodule \"y\"]\n\t\tpath = y\n\t\turl = official-url-of-y\n\nand now you just do \"git submodule init\" and you should be all done \n(again, the \"git submodule init\" thing you could do by hand by editing \nthe .git/config file, but since you can do it automatically in-place, \nthere's no real point).\n\n\t\tLinus\n"}]}