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

Unexpected behavior using -c to pass url.<site>.insteadof

From
EBEric Brunson <brunson@brunson.com>
Date
May 8, 2014, 22:35 UTC
Message-ID
<536C06AE.1080103@brunson.com>
Is this the expected operation using git -c to override gitconfig settings?
This is default behavior:
     $ git ls-remote git://original.site/origin
     fatal: unable to connect to original.site:

This is what I expected, override with an insteadof url using -c on the command line:

     $ git -c 
url.ssh://replace.site:1234/.insteadof=git://original.site/ ls-remote 
git://original.site/origin
     ssh: Could not resolve hostname replace.site: Name or service not known
Create a URL in ~/.gitconfig:
     $ git config --global url.ssh://other.site/.insteadof 
git://original.site/
     $ cat ~/.gitconfig
     [url "ssh://other.site/"]
         insteadof = git://original.site/
Works as expected, correctly substitutes other.site for original.site:
     $ git ls-remote git://original.site/origin
     ssh: Could not resolve hostname other.site: Name or service not known

The same -c command as above doesn't override the ~/.gitconfig setting, still substitutes other.site:

     $ git -c 
url.ssh://replace.site:1234/.insteadof=git://original.site/ ls-remote 
git://original.site/origin
     ssh: Could not resolve hostname other.site: Name or service not known
I've also reproduced in git 1.9.0 and 2.0.0-rc2.

Am I simply misunderstanding the documentation, it doesn't really discuss what should happen with multivar settings?

Thanks, e.

Message 1 of 1 in “Unexpected behavior using -c to pass url.<site>.insteadof”
  1. Eric BrunsonMay 8, 2014

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.