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

Re: Trying to use insteadOf trick to use different SSH keys for separate github accounts - not working

From
AQAsfand Qazi <ayqazi@gmail.com>
Date
Dec 16, 2017, 10:04 UTC
Message-ID
<CAFTSPUWOhyBamNEJzbSDqZW+GE38+PeW6R+DXnY77yo1dbYQ7Q@mail.gmail.com>
In-Reply-To
<20171216094840.GA32706@sigill.intra.peff.net>
Thanks it worked! I was reading all the tutorials wrong all this time...
Regards,
     Asfand
On 16 December 2017 at 09:48, Jeff King <peff@peff.net> wrote:
Show 22 quoted lines
> On Sat, Dec 16, 2017 at 07:50:02AM +0000, Asfand Qazi wrote:
>
>> I found out about the 'insteadOf' setting, and thought it would work.
>> So I added this to my global git config:
>>
>> [url "git@github.com:MyCompany/"]
>> insteadOf = git@work.github.com:MyCompany/
>>
>> and left the SSH hostname setting where it was. Then I tried doing:
>>
>> git clone git:github.com/MyCompany/la-repo.git
>>
>> But it won't work. With GIT_TRACE=2, I get:
>
> If I'm reading it right, you have the config backwards. You want to
> convert git@github.com from Go's invocation of Git into your special
> "work" alias. So:
>
>   [url "git@work.github.com:MyCompany/"]
>   insteadOf = "git@github.com:MyCompany/"
>
> -Peff
Previous: Jeff King
Message 3 of 3 in “Trying to use insteadOf trick to use different SSH keys for separate github accounts - not working”
  1. Asfand QaziDec 16, 2017
  2. Jeff KingDec 16, 2017
  3. Asfand QaziDec 16, 2017

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.