From: <rsbecker@nexbridge.com>
To: <git@vger.kernel.org>
Cc: <avarab@gmail.com>
Subject: [Question] Switching the URI from SSH to HTTPS for submodules
Date: Mon, 6 Dec 2021 18:10:30 -0500 [thread overview]
Message-ID: <001501d7eaf6$79d8e170$6d8aa450$@nexbridge.com> (raw)
This is a follow-up to the conversation at #git-devel Standup today.
We encountered the following situation. Our normal clone practice is to use
SSH URIs. So, the clone is straightforward with the main (8 year old) repo
of the style:
git@bitbucket.org:project/repo.git
with submodules referenced as:
git@bitbucket.org:project/module.git
When in SSH mode, clones are simple with --recurse-submodules doing what we
want. However, we had to clone on a system where SSH was locked down and we
could only use HTTPS. The form of the URIs changed rather radically:
https://user@bitbucket.org/project/repo.git
which caused the submodule clone not to work. Fortunately, the number of
submodules was low, so a manual edit of .gitmodules (with update-index
--assume-unchanged) and .git/modules and .git/config was not onerous.
However, we should be able to redirect the configuration without having to
do that. Our directory references are all relative to the main repo, so
those did not have to change. We still use SSH for most work with the repo
but needed to get source onto a test system for debugging.
I would like to put together a best practice section in
Documentation/gitsubmodules.txt on the subject, but really don't think I did
this *temporary* change the most effective way. I'm looking for better
practices than I used - I'm sure there is at least one. There may be code
changes involved, particularly since .gitmodules is tracked and contains the
full URI (maybe it should not). One option we also explored was explicitly
specifying the URI for each submodule using set-url, which works but it
seems like there should be something in clone that redirects the part of the
URI relative to the main repo - although that would only work in the special
case where the submodules have the same host and project as the main repo.
-Randall
next reply other threads:[~2021-12-06 23:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 23:10 rsbecker [this message]
2021-12-06 23:53 ` [Question] Switching the URI from SSH to HTTPS for submodules Robert Coup
2021-12-07 14:50 ` rsbecker
2021-12-08 12:51 ` Fabian Stelzer
2021-12-08 13:44 ` rsbecker
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='001501d7eaf6$79d8e170$6d8aa450$@nexbridge.com' \
--to=rsbecker@nexbridge.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).