Git Change Remote Repo URL - ashish9342/FreeCodeCamp GitHub Wiki
The git remote set-url
command changes an existing remote repository URL.
This command takes two arguments:
-
An existing remote name. For example, origin or upstream are two common choices.
-
A new URL for the remote. For example,
https://github.com/USERNAME/OTHERREPOSITORY.git
So to change the URL of a remote repository you would do something like this:
- View the existing remote repository:
git remote -v
- Change the URL of the remote repository:
git remote set-url origin https://github.com/USERNAME/OTHERREPOSITORY.git
- And you may verify the new remote repository by doing:
git remote -v
For more information check out this github article.