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

Re: Unable to change remote url of origin

From
PBPetr Bena <petr@bena.rocks>
Date
Mar 27, 2019, 13:01 UTC
Message-ID
<1af53933-86ad-6272-c564-087a462d7336@bena.rocks>
In-Reply-To
<20190327125737.GA20395@alpha>
On 27/03/2019 13:57, Kevin Daudt wrote:
Show 61 quoted lines
> On Wed, Mar 27, 2019 at 01:25:27PM +0100, Petr Bena wrote:
>> Hello,
>>
>> I used to change remote URL simply by editing .git/config (which may not be
>> most correct way), but out of sudden I am no longer able to do that. So I
>> decided to do it the "proper way" but still - to no avail. Here is what I do
>> and also it's visible what is wrong:
>>
>> # Display remote URL
>>
>> petr.bena@MacBook:~/Documents/grumpy$ git remote -v
>> origin    git@github.com:grumpy-irc/grumpy (fetch)
>> origin    git@github.com:grumpy-irc/grumpy (push)
>>
>> #Now change it to HTTPS instead of SSH
>>
>> petr.bena@MacBook:~/Documents/grumpy$ git remote set-url origin
>> https://github.com/grumpy-irc/grumpy
>>
>> # Verify if it has changed
>>
>> petr.bena@MacBook:~/Documents/grumpy$ git remote -v
>> origin    git@github.com:grumpy-irc/grumpy (fetch)
>> origin    git@github.com:grumpy-irc/grumpy (push)
>>
>>
>> It's still SSH. What am I doing wrong?
>>
>> petr.bena@MacBook:~/Documents/grumpy$ git --version
>> git version 2.21.0
>>
>>
>> petr.bena@MacBook:~/Documents/grumpy$ cat .git/config
>> [core]
>>      repositoryformatversion = 0
>>      filemode = true
>>      bare = false
>>      logallrefupdates = true
>>      ignorecase = true
>>      precomposeunicode = true
>> [submodule]
>>      active = .
>> [remote "origin"]
>>      url = https://github.com/grumpy-irc/grumpy
>>      fetch = +refs/heads/*:refs/remotes/origin/*
>> [branch "master"]
>>      remote = origin
>>      merge = refs/heads/master
>> [submodule "src/libgp"]
>>      url = http://github.com/grumpy-irc/libgp
>> [submodule "src/libirc"]
>>      url = http://github.com/grumpy-irc/libirc
>> [branch "remote_scripts"]
>>      remote = origin
>>      merge = refs/heads/remote_scripts
>>
> Hello Petr,
>
> What does git config --show-origin remoe.origin.url return?
>
> Kind regards, Kevin
Hello Kevin,

petr.bena@MacBook:~/Documents/grumpy$ git config --show-origin remote.origin.url file:.git/config    https://github.com/grumpy-irc/grumpy

However git push is still accessing SSH version (which is blocked by FW in this place):

petr.bena@MacBook:~/Documents/grumpy$ git push -v Pushing to git@github.com:grumpy-irc/grumpy

I need to change it to HTTPS
Previous: Kevin DaudtNext: Andreas Schwab
Message 3 of 6 in “Unable to change remote url of origin”
  1. Petr BenaMar 27, 2019
  2. Kevin DaudtMar 27, 2019
  3. Petr BenaMar 27, 2019
  4. Andreas SchwabMar 27, 2019
  5. Petr BenaMar 28, 2019
  6. Petr BenaMar 28, 2019

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.