Re: How should submodules use different sshCommand during initial update?
- From
- Shibo 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?