From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Cc: Peter Voss <info@petervoss.org>
Subject: Re: Submodule using different repository URLs
Date: Mon, 13 Jul 2009 12:59:42 +0200 [thread overview]
Message-ID: <200907131259.42313.johan@herland.net> (raw)
In-Reply-To: <5BE6F3DC-4B00-4D84-8D0E-41057735483F@petervoss.org>
On Monday 13 July 2009, Peter Voss wrote:
> Hi,
>
> I want to use the git submodule feature to move part of my code to a
> different repository at github.
>
> The issue is that developers should use different repository URLs for
> the submodule depending on whether they have commit rights or not.
>
> At the beginning I was using the public URL to set-up the submodule:
> git submodule add git://github.com/x/mymodule.git mymodule
>
> The issue is that some developers are working behind a firewall that
> blocks the git protocol. These could only use the git@github.com:x/
> mymodule.git URL to get access.
> But other developers can only go through the public URL git://
> github.com/x/mymodule.git. So whatever I use it won't work for
> everybody.
>
> What's the best way to deal with that? Could I set-up different
> repository URLs for one and the same submodule and use which one is
> appropriate?
You might be able to pull this off using relative submodule URLs. If the
submodule URLs in .gitmodules are relative (i.e. ../foo.git or
similar), they will be resolved to absolute URLs using the origin URL
of the super-repo. I.e. if you cloned the super-repo from
git://github.com/x/mymodule.git, the ../foo.git submodule will be
cloned from git://github.com/x/foo.git, and if you cloned from
git@github.com:x/mymodule.git, the submodule will be cloned from
git@github.com:x/foo.git.
Hope this helps,
Have fun! :)
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
next prev parent reply other threads:[~2009-07-13 11:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-13 9:57 Submodule using different repository URLs Peter Voss
2009-07-13 10:20 ` Santi Béjar
2009-07-13 12:04 ` Peter Voss
2009-07-13 10:59 ` Johan Herland [this message]
2009-07-13 11:51 ` Peter Voss
2009-07-13 12:28 ` Johan Herland
2009-07-13 12:43 ` Johan Herland
2009-07-13 13:33 ` Peter Voss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907131259.42313.johan@herland.net \
--to=johan@herland.net \
--cc=git@vger.kernel.org \
--cc=info@petervoss.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox