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

Re: Use different ssh keys for different github repos (per-url sshCommand)

From
Jeff King <peff@peff.net>
Date
Jul 19, 2018, 16:47 UTC
Message-ID
<20180719164704.GB4868@sigill.intra.peff.net>
In-Reply-To
<87zhynbd9z.fsf@evledraar.gmail.com>
On Thu, Jul 19, 2018 at 02:50:16PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 18 quoted lines
> > I thought of writing a wrapper script to deduce the key from the arguments:
> >
> >     git@github.com git-upload-pack '/theorganization/privaterepo.git'
> >
> > Is this the only option?
> 
> Yes, I had a similar problem a while ago (which I sent an RFC patch for)
> which shows a script you can use:
> https://public-inbox.org/git/20180103102840.27897-1-avarab@gmail.com/
> 
> It would be nice if this were configurable. Instead of the way you
> suggested, it would be more general if we supported:
> 
>     [Include "remote:git@github.com:theorganization*"]
>     path = theorganization.config
> 
> Although I'm sure we'd have some interesting chicken & egg problems
> there when it comes to bootstrapping the config parsing.

I don't think we'd ever support this via the include mechanism. The idea of "which remote are we looking at" is specific to a particular part of an operation. Whereas config parsing is generally process-wide, so it has to be based on a property of the whole process (like "which directory are we in"). Maybe that's what you meant by chicken and egg.

If we were to make this more configurable, it would probably be more like existing http.* config, which loads all the config, but then does URL-specific matching when applying the config to a particular operation.

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Sitaram Chamarty
Message 3 of 7 in “Use different ssh keys for different github repos (per-url sshCommand)”
  1. Basin IlyaJul 19, 2018
  2. Ævar Arnfjörð BjarmasonJul 19, 2018
  3. Jeff KingJul 19, 2018
  4. Sitaram ChamartyJul 19, 2018
  5. Sitaram ChamartyJul 19, 2018
  6. Jeff KingJul 19, 2018
  7. Basin IlyaJul 19, 2018

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.