git/list[1] front-page[2] threads[3] people[4] search[5] about
 

ssh username environment variable

From
Chris Packham <judge.packham@gmail.com>
Date
Jan 8, 2010, 20:24 UTC
Message-ID
<a038bef51001081224l33164526y51e5ca064b82b73a@mail.gmail.com>
Hi List,

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?

I would normally use
  git clone ssh://myname@example.com/repo.git
but I'm cloning to a relatively public network drive  (corporate
overlords don't want git no mater what I say) so I want to do
something like
  GIT_SSH_USER=myname  git clone ssh://example.com/repo.git
So that my user name doesn't show in the resulting remote.origin.url

I know I can probably just remove my user name from the config after the the fact but I have to do this for a few repos so I thought I'd ask if there was a magic environment variable I could set.

Thanks.
Next: Shawn O. Pearce
Message 1 of 4 in “ssh username environment variable”
  1. Chris PackhamJan 8, 2010
  2. Shawn O. PearceJan 8, 2010
  3. Junio C HamanoJan 8, 2010
  4. Chris PackhamJan 8, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.