arthur

Austin Ofor

Posted on Sep 19, 2022

How To Change Git Remote Origin

Change Git Remote URL

In order to change the URL of a Git remote, you have to use the “git remote set-url” command and specify the name of the remote as well as the new remote URL to be changed.

$ git remote set-url <remote_name> <remote_url>

For example, let’s say that you want to change the URL of your Git origin remote.

In order to achieve that, you would use the “set-url” command on the “origin” remote and you would specify the new URL.

$ git remote set-url origin https://git-repo/new-repository.git

git change remote using set url

Congratulations, you successfully changed the URL of your Git remote!

In order to verify that the changes were made, you can use the “git remote” command with the “-v” option (for verbose)

$ git remote -v

list remote using git remote

A forum to write, learn and earn.

Made with love and Next.js with a touch of tailwind.

Built by @kwadoskii

TSB © 2021 - 2026