Comment changer l'URL pour un dépôt Git distant

Mots clés : giturlgit-remotegit

meilleur 5 Réponses Comment changer l'URL pour un dépôt Git distant

vote vote

91

git remote set-url origin new.git.url/here 
vote vote

82

git remote -v # View existing remotes # origin  https://github.com/user/repo.git (fetch) # origin  https://github.com/user/repo.git (push)  git remote set-url origin https://github.com/user/repo2.git # Change the 'origin' remote's URL  git remote -v # Verify new remote URL # origin  https://github.com/user/repo2.git (fetch) # origin  https://github.com/user/repo2.git (push) 
vote vote

78

git remote set-url origin ssh://newhost.com/usr/local/gitroot/myproject.git 
[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = ssh://oldhost.com/usr/local/gitroot/myproject.git 
vote vote

62

git remote set-url origin https://github.com/myName/GitTest.git 
vote vote

53

git remote set-url origin git://new.location 
git remote -v # origin  git://new.location (fetch) # origin  git://new.location (push) 
git push -u origin master 

Questions similaires