From: Junio C Hamano Date: Fri, 08 Jan 2010 20:34:43 GMT Subject: Re: ssh username environment variable Message-ID: <7vskag9vz0.fsf@alter.siamese.dyndns.org> In-Reply-To: <20100108202958.GL32155@spearce.org> "Shawn O. Pearce" writes: > Chris Packham wrote: >> Just wondering if there is an environment variable I can use to tell >> git or ssh what user name to use for the ssh transport? > > No. But you can hack around it: > > cat >$HOME/bin/git-ssh > #!/bin/sh > ssh -l $GIT_SSH_USER "$@" > ^D > > GIT_SSH=$HOME/bin/git-ssh GIT_SSH_USER=myname git clone ... I thought the standard answer was "use $HOME/.ssh/config", to set User by keying on the remote hostname to which you are going.