• 0

How to change the remote url for a repository

Many times when you start out on a personal project, its hard to decide what to choose as the project name and you temporarily choose a name that you might not like later on. If no-one else is collaborating with you on the project, you can change the name of the project on github. But that also requires you to change the remote url in your local repository.

To list the remote names that map to the remote URL's, issue the command

git remote -v

Once you decide which remote you want to map to your new remote url, issue the following command

git remote set-url remoteName yourRemoteUrl

For e.g. To change the url of the origin, to another-url, you would do

git remote set-url origin another-url