How to change the remote url for a repository

Many times when you start out on a per­sonal project, its hard to decide what to choose as the project name and you tem­porar­ily choose a name that you might not like later on. If no-one else is col­lab­o­rat­ing 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 fol­low­ing command

git remote set-url remoteName yourRemoteUrl

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

git remote set-url origin another-url

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *