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

Specifying a private key when connecting to a remote SSH repo

From
BYBreck Yunits <breck7@gmail.com>
Date
Sep 11, 2013, 23:19 UTC
Message-ID
<CAOgHByvTtNDho50B+pECMeXkq=3FF8EheFbP4iQbKYTiAPTwYw@mail.gmail.com>

It would be very helpful if you could specify the path to the private key to use for ssh remotes just like in ssh.

``` git push origin master -i 'path_to_key' ```

Althought there are workarounds involving ssh config, if you have a server that has hundreds of git repos, each with the own private key, those workarounds become unusable.

This is a very popular request with thousands of comments about it, for example:
http://superuser.com/questions/232373/tell-git-which-private-key-to-use
http://stackoverflow.com/questions/3496037/how-to-specify-which-ssh-key-to-use-within-git-for-git-push-in-order-to-have-git
Thoughts?
Thanks!

Breck Yunits breck7@gmail.com

Next: Junio C Hamano
Message 1 of 5 in “Specifying a private key when connecting to a remote SSH repo”
  1. Breck YunitsSep 11, 2013
  2. Junio C HamanoSep 12, 2013
  3. Jeff KingSep 12, 2013
  4. Junio C HamanoSep 12, 2013
  5. Breck YunitsSep 12, 2013

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.