{"thread":{"id":"14658","subject":"Submodules: Publishing a locally created submodule.","startedAt":"2008-07-24T15:40:43Z","lastAt":"2008-07-25T00:05:44Z","messageCount":4,"participants":["Thomas Adam","Sean Estabrooks","Mark Levedahl"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"84731","messageId":"18071eea0807240840g79da962ci8fbc65546d496323@mail.gmail.com","threadId":"14658","inReplyTo":null,"subject":"Submodules: Publishing a locally created submodule.","fromName":"Thomas Adam","fromEmail":"thomas.adam22@gmail.com","sentAt":"2008-07-24T15:40:43Z","receivedAt":"2008-07-24T15:40:43Z","isPatch":false,"sender":{"key":"thomas.adam22@gmail.com","avatar":"https://gravatar.com/avatar/137f9858bc6bfd5b2f743aefd988c81ce0cbd306248889df80e269519cfc8741?d=mp&s=160"},"body":"Hello all,\n\nI'm a little confused having read the submodule chapter in the GIT\nusers' manual and was wondering if someone here can help.\n\nI've setup a bare repository with some submodule in it which I and\nothers are able to clone from just fine -- in that sense, it acts just\nlike an \"ordinary\" repository.\n\nBut I am a little stuck getting my head around a scenario:\n\nMost us here work in a very CVS-like way.  I did the following:\n\ngit clone ssh://foo/bar/project myclone\ncd ./myclone\n\nIn there is a directory which is a submodule.  At the time I created\nthe bare repo it was cloned already from a repo which had a submodule.\n I decided I wanted another submodule to be published so I did this:\n\ncp -r ./mysubmoduleA ./mysubmoduleB && rm ./mysubmoduleB/.git\n\nNow:  I want to make mysubmoduleB a submodule which I can publish to\nthe shared repository and when others pull, to see that submodule and\nbe able to treat it as such.\n\nBut I can't see how to do that.  Can someone help?\n\nMany thanks in advance.\n\n-- Thomas Adam\n"},{"id":"84735","messageId":"BLU0-SMTP14B7D0278740B42D339433AE870@phx.gbl","threadId":"14658","inReplyTo":"18071eea0807240840g79da962ci8fbc65546d496323@mail.gmail.com","subject":"Re: Submodules: Publishing a locally created submodule.","fromName":"Sean Estabrooks","fromEmail":"seanlkml@sympatico.ca","sentAt":"2008-07-24T16:21:30Z","receivedAt":"2008-07-24T16:21:30Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Thu, 24 Jul 2008 16:40:43 +0100\n\"Thomas Adam\" <thomas.adam22@gmail.com> wrote:\n\n> Now:  I want to make mysubmoduleB a submodule which I can publish to\n> the shared repository and when others pull, to see that submodule and\n> be able to treat it as such.\n\nHi Thomas,\n\nSubmodules are very much fully formed independent repositories.   So the\nfirst step is to create a new Git repo that holds the files you want.  Publish\nthis repo in a public place, presumably the same place you published your\nother submodules.\n\nIn your supermodule use  \"git submodule add\" to include the new public repo\nas a submodule in the directory of your choice.   After which you can commit\nthe change and push it out.  Other people will need to do \"git submodule update\"\nto make their repos aware of the new submodule.\n\nHTH,\nSean\n"},{"id":"84806","messageId":"48891088.40709@gmail.com","threadId":"14658","inReplyTo":"18071eea0807240840g79da962ci8fbc65546d496323@mail.gmail.com","subject":"Re: Submodules: Publishing a locally created submodule.","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2008-07-24T23:30:16Z","receivedAt":"2008-07-24T23:30:16Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Thomas Adam wrote:\n> Hello all,\n> \n> \n> Now:  I want to make mysubmoduleB a submodule which I can publish to\n> the shared repository and when others pull, to see that submodule and\n> be able to treat it as such.\n> \n> But I can't see how to do that.  Can someone help?\n> \n> Many thanks in advance.\n> \n> -- Thomas Adam\n\ngit submodule add <URL where this will exist> ./mysubmoduleB\n\nwill recognize that mysubmoduleB is already a valid git repo and add it as is at \nthe current location to the superproject.\n\nMark\n"},{"id":"84812","messageId":"18071eea0807241705j1359bc7ei46d74540d9090f6d@mail.gmail.com","threadId":"14658","inReplyTo":"48891088.40709@gmail.com","subject":"Re: Submodules: Publishing a locally created submodule.","fromName":"Thomas Adam","fromEmail":"thomas.adam22@gmail.com","sentAt":"2008-07-25T00:05:44Z","receivedAt":"2008-07-25T00:05:44Z","isPatch":false,"sender":{"key":"thomas.adam22@gmail.com","avatar":"https://gravatar.com/avatar/137f9858bc6bfd5b2f743aefd988c81ce0cbd306248889df80e269519cfc8741?d=mp&s=160"},"body":"Hello --\n\n2008/7/25 Mark Levedahl <mlevedahl@gmail.com>:\n> git submodule add <URL where this will exist> ./mysubmoduleB\n>\n> will recognize that mysubmoduleB is already a valid git repo and add it as\n> is at the current location to the superproject.\n\nAh -- now that was missing from the documentation (the syntax; not the\nintention.)  Thanks.\n\nIt seems my brain has turned to mush so I need to go back to square\none and verify the steps for this are accurate.  If I am doing this\narse-about-face, do say.  ;)\n\nI've mentioned I am using a bare repository which is shared amongst\ndevelopers.  We've been using one fine for normal development and for\nvarious reaons I am creating a new repository to be filled with\nsubmodules.  I shall call this \"SM\".\n\nOur \"superproject\" is a directory hierarchy with interspersed files.\nOn the server I did this:\n\nserver% cd /usr/src/SM\nserver% git init\nserver% cd ./superproject\nserver% git init\nserver% git add .\nserver% git commit -m \"Initial checkin\"\nserver% cd ..\nserver% git submodule add /path/to/usr/src/SM\nserver% git commit -a -m \"Submodules...\"\n\nThen cloned a bare repo from that which I was able to clone locally\nand do stuff in.  I could push stuff out too for that one project.\nBut how from this clone do I then publish any further submodules I\nmight create locally?  I can't very well do so directly in my checkout\n-- it has no concept of where the submodules are.  I could go to the\nserver, add another directory as a submodule (as I've done with\n\"superproject\" above --- but then any changes under /usr/src/SM on the\nserver are local -- the bare repo has no knowledge of any changes made\nthere.\n\nDoes this even make sense?   ;)\n\nThanks in advance.\n\n-- Thomas Adam\n"}]}