How to change a remote URL in Git
In this tutorial, we are going to learn about how to change a cloned repo remote url in git.
Changing a Git remote URL
- Change your current working directory to the cloned git repo folder.
cd my-git-repo- To change a remote URL we need to run the
git remotecommand followed by theset-url,origin
and your new remote url.
git remote set-url origin https://github.com/saigowthamr/javascript.gitNote: In the above code, you need to add your own remote url after
origin.
- Now we need to verify our remote url is changed successfully or not by running
git remotecommand followed-vflag.
git remote -vThe output will look like this:
origin https://github.com/saigowthamr/javascript.git (fetch)
origin https://github.com/saigowthamr/javascript.com.git (push)

