Subject: Re: [PATCH 0/3] Add support for per-remote and per-namespace SSH options

From: Wesley <[email-masked]>
Date: Fri, 27 Mar 2026 21:02:53 -0400

On 3/27/26 18:06, brian m. carlson wrote:
> On 2026-03-27 at 16:49:35, Wesley wrote:
>> On 3/27/26 12:10, Junio C Hamano wrote:
>>
>>> I somehow thought that this practice is so widespread that it was
>>> one of the few first things any new people learn to do, but perhaps
>>> we do not have a good documentation coverage?
>>
>> As said before it is weird thing to configure a global ssh configuration
>> just for git transport. It doesn't make much sense.
>>
>> The problem with ssh_config usage is that you need to change your ssh
>> config, which is machine global, not just git. And not portable across teams
>> with configurations committed to git. Myrepos is a good example of this. My
>> former employer had this and I know the Perl metacpan project also uses
>> mysrepos. Changing every URL dynamically in committed configs isn't really a
>> nice ask.
> 
> You can also use the conditional inclusion functionality to rewrite URLs
> for repositories in a certain directory with `url.<URL>.insteadOf`.  Or
> you can use conditional inclusion to use `core.sshCommand` with the `-i`
> option set appropriately.

That is what I did and why I thought a simple addition in git would make 
it declarative in git via its configuration. This would limit the 
scripting side for just adding "this identityFile should be used in this 
repo" or "this remote". Including allowing setting sshOpts for specific 
remotes and/or repos.

Cheers,
Wesley

-- 
Wesley

Why not both?