git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How should submodules use different sshCommand during initial update?

From
SXShibo Xia <sbxia25@gmail.com>
Date
Apr 14, 2026, 01:28 UTC
Message-ID
<CAAC4ekquR+eCxTWifOR-X5hgd+rSen8eAUy8cxukouUE57xaoA@mail.gmail.com>
In-Reply-To
<xmqq1pgilufr.fsf@gitster.g>
Hi,
Yes, that would help as a workaround.
If I understand correctly, the idea would be to run:
git submodule init

then adjust submodule.<name>.url entries in the superproject config before the actual clone happens, and only then run:

git submodule update
That does seem workable.

My concern is that this still solves the problem indirectly through URL rewriting / SSH host aliasing, rather than allowing the submodule's SSH behavior itself to be configured more directly.

So I think this answers the practical "how can this be done today?" part, but I am still wondering whether there is a reason Git should not support a more direct per-submodule sshCommand-style configuration.

Thanks, Shibo Xia

Junio C Hamano <gitster@pobox.com> 于2026年4月14日周二 00:02写道:
Show 10 quoted lines
>
> Shibo Xia <sbxia25@gmail.com> writes:
>
> > My use case is that different submodules may need different SSH identities or
> > different SSH command settings.
>
> Would it help to do "submodule init" separately from "submodule
> update"?  Then you have a chance to tweak the submodule.*.url
> configuration items in the superproject repository before the clone
> actually happens, I would imagine?
Previous: Junio C HamanoNext: Jeff King
Message 3 of 5 in “How should submodules use different sshCommand during initial update?”
  1. Shibo XiaApr 13, 2026
  2. Junio C HamanoApr 13, 2026
  3. Shibo XiaApr 14, 2026
  4. Jeff KingApr 14, 2026
  5. Shibo XiaApr 14, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.