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

URL rewrite in local config unable to override global config rule

From
SSSaksham Saxena <saksham.saxena.1994@ieee.org>
Date
Jun 16, 2016, 10:14 UTC
Message-ID
<CABYP2JZU5wqxCK1B7b_fDB0Lqz4-7a_Erb5dHKReZHQecxC8QQ@mail.gmail.com>
Hello everyone

I came across an anomaly in git recently, and would like to share it here. Please suggest if this is a bug, or if my approach is wrong.

Summary : Added a new rule to the local config of a git repo by issuing ' git config --local url."https://".insteadOf git:// ', but it wasn't observed by git as it kept using "git://".

Details : I had set my global config to use "git://" instead of "https://", as I prefer working with SSH. Recently, I began writing a 'GitHub Wiki' of one of my GitHub projects, and, apparently, those Wikis are normal git repositories, and can be cloned and edited locally. However, the clone url available is served over HTTPS only, and doesn't support any other protocol. Naturally, I had to change my config to change the behavior of git while connecting to the remote. I thus proceeded to update the local config of the repo to use "https://" instead of "git://". However, my remote urls weren't updated. I manually then removed these remote urls and added new HTTPS ones. Yet, the remote urls showed "git://" protocol in them. Screenshot of the terminal window can be found here (http://i.stack.imgur.com/y7GMP.png).

I tried to add the "pushInsteadOf" rule as well, but again, it didn't take effect. This is particularly disappointing, because the local config have the highest priority, and yet it isn't effective at all. Because of the limitation of my remote, I cannot even push my changes. True, that I can dig up some dirty workarounds, but I do not understand why this behavior is seen.

I have also asked this on the popular Stack Overflow forum (http://stackoverflow.com/questions/37844460/git-remote-url-is-not-updating). If any of the moderators here do not find this issue as a bug, then they may help me out on the forum itself (if you happen to be on it) to reduce the noise on this thread.

I hope I described my problem clearly. Awaiting response.

Regards Saksham Saxena

Next: Jeff King
Message 1 of 6 in “URL rewrite in local config unable to override global config rule”
  1. Saksham SaxenaJun 16, 2016
  2. Jeff KingJun 16, 2016
  3. Saksham SaxenaJun 17, 2016
  4. Jeff KingJun 17, 2016
  5. Saksham SaxenaJun 18, 2016
  6. Jeff KingJun 18, 2016

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.