Git development
 help / color / mirror / Atom feed
* How should submodules use different sshCommand during initial update?
@ 2026-04-13 15:45 Shibo Xia
  2026-04-13 16:02 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Shibo Xia @ 2026-04-13 15:45 UTC (permalink / raw)
  To: git

Hi,

I have a question about submodules and SSH authentication during the initial
git submodule update --init step.

I understand that there are already a few ways to influence SSH behavior:

core.sshCommand at the repository level

GIT_SSH_COMMAND at the command level

SSH host aliases and other settings in ~/.ssh/config

However, I am running into a more specific problem with submodules.

My use case is that different submodules may need different SSH identities or
different SSH command settings. For an already initialized submodule, this can
be handled by entering the submodule repository and configuring it separately.
But during the initial git submodule update --init, the submodule does not yet
have its own local config, so there does not seem to be a clean per-submodule
way to do this from Git itself.

In practice, the usual workaround seems to be putting the logic into SSH
configuration and encoding it through host aliases or URL layout. That works,
but it also means the authentication behavior is kept outside Git's submodule
configuration, even though the submodule remote itself is already configured in
Git.

So my questions are:

Is there already a recommended Git-native way to handle different
sshCommand values for different submodules during initial clone/update?

If not, would support for something like a per-submodule sshCommand
configuration be considered reasonable?

Has this been discussed before specifically in the context of submodule
initialization, rather than per-remote SSH options in general?

I am not sending a patch yet. I first wanted to ask whether this is considered
a real gap in current submodule behavior, or whether the expectation is that SSH
configuration should remain the only solution here.

Best regards,
Shibo Xia

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-14  7:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13 15:45 How should submodules use different sshCommand during initial update? Shibo Xia
2026-04-13 16:02 ` Junio C Hamano
2026-04-14  1:28   ` Shibo Xia
2026-04-14  6:15     ` Jeff King
2026-04-14  7:25       ` Shibo Xia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox