How to change the remote url of a local repository

The git remote set-url command changes an existing remote repository URL.


git remote set-url <name> <newurl> <oldurl>

The git remote set-url command takes two arguments:

  • An existing remote name <name>. For example, origin (or upstream are two common choices).
  • The new url <newurl> followed by the old url <oldurl>.


git remote set-url origin

Categories: Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.