Git - Updated the remote URL, but not changing old URLs? -


i'm attempting update remote url repo using:

git remote set-url origin https://newserver/root/repo.git 

the expected result should be:

git remote -v origin  http://newserver/root/repo.git (fetch) origin  http://newserver/root/repo.git (push) 

however regardless of try, , articles @ online, result this:

git remote -v origin  http://oldserver/root/repo.git (fetch) origin  http://oldserver/root/repo.git (push) origin  http://newserver/root/repo.git (push) 

when try use

git remote rm origin 

it removes new/third entry, yet leaves other original entries reason. see:

git remote rm origin git remote -v origin  http://oldserver/root/repo.git (fetch) origin  http://oldserver/root/repo.git (push) 

after this, if open .git/config in vi, there's no entries @ all. manually adding new server origin in config file yields same result - see 2 old servers fetch , push, , third new entry listed origin/push.

what doing wrong? have tried searching high , low, yet because of terminology i'm not sure if i'm searching right information. thanks!

try way:

git config remote.origin.url https://newserver/root/repo.git 

you used https, maybe try use ssh, example

git remote set-url origin git@github.com:username/repository.git 

learn more: https://help.github.com/articles/changing-a-remote-s-url/#switching-remote-urls-from-https-to-ssh


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -