Git Git Remote Change remote url of your Git repository

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

You may want to do this if the remote repository is migrated. The command for changing the remote url is:

git remote set-url

It takes 2 arguments: an existing remote name (origin, upstream) and the url.

Check your current remote url:

git remote -v
origin    https://bitbucket.com/develop/myrepo.git (fetch)
origin    https://bitbucket.com/develop/myrepo.git (push)

Change your remote url:

git remote set-url origin https://localserver/develop/myrepo.git

Check again your remote url:

git remote -v
origin    https://localserver/develop/myrepo.git (fetch)
origin    https://localserver/develop/myrepo.git (push)


Got any Git Question?