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

Leave a Reply

Your email address will not be published.