Re: how to pass ssh options to git?

From: Linus Torvalds <>
Date: 2006-11-03 03:10:12
On Thu, 2 Nov 2006, Michael S. Tsirkin wrote:

> Quoting r. Dennis Stosberg <>:
> > Subject: Re: how to pass ssh options to git?
> > 
> > Michael S. Tsirkin wrote:
> > 
> > > I know, problem is I want to use different options at different times.
> > > I could use -F configfile ssh option, but how to pass *that* to git?
> >  
> > You can set the path of the ssh executable to use with the GIT_SSH
> > environment variable.  Create a shell script like
> > 
> > #!/bin/sh
> > exec ssh --your-options-- $*
> > 
> > and make GIT_SSH point to it.
> Thanks, I'll try that.

It's really better to use a ".ssh/config" file instead.

I realize that you want to use different options "dynamically", but what 
you can do is to just have different "fake hostnames". For example, you 
can do

		User myname
		IdentityFile /home/myname/.ssh/private-identity
		User groupname
		IdentityFile /home/myname/.ssh/public-identity

and now you can ssh to "" using different identities by just using 
"" and "" respectively. You can do pretty 
much any options that way.

Very convenient, if you have just a couple of "standard" setups.

Obviously we _could_ just add support for arbitrary ssh options, but it 
gets pretty ugly pretty quickly, so I'd suggest trying to use the 
.ssh/config approach with different hostnames if that is at all possible.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at
Received on Fri Nov 03 03:11:04 2006

This archive was generated by hypermail 2.1.8 : 2006-11-03 03:11:57 EST