* Submodules: Publishing a locally created submodule.
@ 2008-07-24 15:40 Thomas Adam
2008-07-24 16:21 ` Sean Estabrooks
2008-07-24 23:30 ` Mark Levedahl
0 siblings, 2 replies; 4+ messages in thread
From: Thomas Adam @ 2008-07-24 15:40 UTC (permalink / raw)
To: git mailing list
Hello all,
I'm a little confused having read the submodule chapter in the GIT
users' manual and was wondering if someone here can help.
I've setup a bare repository with some submodule in it which I and
others are able to clone from just fine -- in that sense, it acts just
like an "ordinary" repository.
But I am a little stuck getting my head around a scenario:
Most us here work in a very CVS-like way. I did the following:
git clone ssh://foo/bar/project myclone
cd ./myclone
In there is a directory which is a submodule. At the time I created
the bare repo it was cloned already from a repo which had a submodule.
I decided I wanted another submodule to be published so I did this:
cp -r ./mysubmoduleA ./mysubmoduleB && rm ./mysubmoduleB/.git
Now: I want to make mysubmoduleB a submodule which I can publish to
the shared repository and when others pull, to see that submodule and
be able to treat it as such.
But I can't see how to do that. Can someone help?
Many thanks in advance.
-- Thomas Adam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Submodules: Publishing a locally created submodule.
2008-07-24 15:40 Submodules: Publishing a locally created submodule Thomas Adam
@ 2008-07-24 16:21 ` Sean Estabrooks
2008-07-24 23:30 ` Mark Levedahl
1 sibling, 0 replies; 4+ messages in thread
From: Sean Estabrooks @ 2008-07-24 16:21 UTC (permalink / raw)
To: Thomas Adam; +Cc: git mailing list
On Thu, 24 Jul 2008 16:40:43 +0100
"Thomas Adam" <thomas.adam22@gmail.com> wrote:
> Now: I want to make mysubmoduleB a submodule which I can publish to
> the shared repository and when others pull, to see that submodule and
> be able to treat it as such.
Hi Thomas,
Submodules are very much fully formed independent repositories. So the
first step is to create a new Git repo that holds the files you want. Publish
this repo in a public place, presumably the same place you published your
other submodules.
In your supermodule use "git submodule add" to include the new public repo
as a submodule in the directory of your choice. After which you can commit
the change and push it out. Other people will need to do "git submodule update"
to make their repos aware of the new submodule.
HTH,
Sean
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Submodules: Publishing a locally created submodule.
2008-07-24 15:40 Submodules: Publishing a locally created submodule Thomas Adam
2008-07-24 16:21 ` Sean Estabrooks
@ 2008-07-24 23:30 ` Mark Levedahl
2008-07-25 0:05 ` Thomas Adam
1 sibling, 1 reply; 4+ messages in thread
From: Mark Levedahl @ 2008-07-24 23:30 UTC (permalink / raw)
To: git; +Cc: git mailing list
Thomas Adam wrote:
> Hello all,
>
>
> Now: I want to make mysubmoduleB a submodule which I can publish to
> the shared repository and when others pull, to see that submodule and
> be able to treat it as such.
>
> But I can't see how to do that. Can someone help?
>
> Many thanks in advance.
>
> -- Thomas Adam
git submodule add <URL where this will exist> ./mysubmoduleB
will recognize that mysubmoduleB is already a valid git repo and add it as is at
the current location to the superproject.
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Submodules: Publishing a locally created submodule.
2008-07-24 23:30 ` Mark Levedahl
@ 2008-07-25 0:05 ` Thomas Adam
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Adam @ 2008-07-25 0:05 UTC (permalink / raw)
To: Mark Levedahl; +Cc: git mailing list
Hello --
2008/7/25 Mark Levedahl <mlevedahl@gmail.com>:
> git submodule add <URL where this will exist> ./mysubmoduleB
>
> will recognize that mysubmoduleB is already a valid git repo and add it as
> is at the current location to the superproject.
Ah -- now that was missing from the documentation (the syntax; not the
intention.) Thanks.
It seems my brain has turned to mush so I need to go back to square
one and verify the steps for this are accurate. If I am doing this
arse-about-face, do say. ;)
I've mentioned I am using a bare repository which is shared amongst
developers. We've been using one fine for normal development and for
various reaons I am creating a new repository to be filled with
submodules. I shall call this "SM".
Our "superproject" is a directory hierarchy with interspersed files.
On the server I did this:
server% cd /usr/src/SM
server% git init
server% cd ./superproject
server% git init
server% git add .
server% git commit -m "Initial checkin"
server% cd ..
server% git submodule add /path/to/usr/src/SM
server% git commit -a -m "Submodules..."
Then cloned a bare repo from that which I was able to clone locally
and do stuff in. I could push stuff out too for that one project.
But how from this clone do I then publish any further submodules I
might create locally? I can't very well do so directly in my checkout
-- it has no concept of where the submodules are. I could go to the
server, add another directory as a submodule (as I've done with
"superproject" above --- but then any changes under /usr/src/SM on the
server are local -- the bare repo has no knowledge of any changes made
there.
Does this even make sense? ;)
Thanks in advance.
-- Thomas Adam
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-25 0:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-24 15:40 Submodules: Publishing a locally created submodule Thomas Adam
2008-07-24 16:21 ` Sean Estabrooks
2008-07-24 23:30 ` Mark Levedahl
2008-07-25 0:05 ` Thomas Adam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).