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

Re: core.sshCommand and url.*.insteadOf for submodules

From
Jeff King <peff@peff.net>
Date
Jan 5, 2017, 17:02 UTC
Message-ID
<20170105170214.6fmsbj6ltbmpvcfb@sigill.intra.peff.net>
In-Reply-To
<CAGZ79kb8TTaJBmVCWK3jnr4RvGjmfmsj3-ieT87wzyFLYi5frQ@mail.gmail.com>
On Thu, Jan 05, 2017 at 05:53:30AM -0800, Stefan Beller wrote:
Show 13 quoted lines
> > My scenario is as follows: I use 2 SSH keys for GitHub, for private and
> > work-related repositories. My default key is my private key. So when I
> > clone a work repository and try getting the submodules, `git submodule
> > update --init` fails. This is also the case when setting
> > `core.sshCommand` and `url.*.insteadOf` (useful for substituting
> > "github.com" by some ~/.ssh/config'ured host).
> 
> which is why e.g.
> git config --global url.https://github.com/.insteadOf git://github.com/
> is not your preferred way here.
> 
> There was some discussion a couple of weeks ago, which settings
> should be kept when recursing into submodules, Jacob and Jeff cc'd.

The only discussion I recall was from last May. But that was about "-c" config on the command-line, and the end decision was that we pass it all down to submodules, per 89044baa8b (submodule: stop sanitizing config options, 2016-05-04).

I think the problem here is more about propagating options from the superproject's repo-level config into the submodules. AFAIK we do not do that at all, but I may have missed some patches in that area.

Another approach would be conditional config includes based on the repo path. With the patches discussed in [1], you could do something like:

  git config --global include./path/to/work/repos.path .gitconfig-work
  git config -f ~/.gitconfig-work url.foo.insteadOf bar
-Peff
[1] http://public-inbox.org/git/20160626070617.30211-1-pclouds@gmail.com/
Previous: Stefan BellerNext: Stefan Beller
Message 3 of 4 in “core.sshCommand and url.*.insteadOf for submodules”
  1. Stefan SchindlerJan 5, 2017
  2. Stefan BellerJan 5, 2017
  3. Jeff KingJan 5, 2017
  4. Stefan BellerJan 5, 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.