I'm unable to change git remote url from git:// to https://.
As illustrated below, git remote set-url isn't working:
$ git remote -v
origin git://github.com/userName/repoName.git (fetch)
origin git://github.com/userName/repoName.git (push)
$ git remote set-url origin https://github.com/userName/repoName.git
$ git remote -v
origin git://github.com/userName/repoName.git (fetch)
origin git://github.com/userName/repoName.git (push)
I have also tried removing the remote and re-adding it, to no avail.
.git/config
[remote "origin"]
url = https://github.com/userName/repoName.git
fetch = +refs/heads/*:refs/remotes/origin/*
I have checked many of the plethora of queries concerning git remote set-url, but none dealing with this issue of set-url not working.
From running $ git config --list I realized that .git/config was forcing git to rename all remotes. See here for more information.
To resolve the issue, you can either:
git config --global --editgit config --global --remove-section url."git://github.com/"The second option is preferable as it is safer than directly editing git config file.
Use command (You maybe must using Administration permission on Windows operating system, or sudo permission on macOS or Linux)
git remote add upstream https://example.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
See https://help.github.com/articles/configuring-a-remote-for-a-fork/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With