How to change the url of a remote git repo...
Nick Raphael

Nick Raphael @nickraphael

About: Brought to you by Nick Raphael. Fullstack azure architect and tech lead. Currently neck deep in dotnet core - azure stack - microservices.

Location:
Sydney, Australia
Joined:
Oct 21, 2019

How to change the url of a remote git repo...

Publish Date: Dec 7 '21
6 0

Hi all,

I recently got myself into the situation where all my local git repos had the wrong remote addresses. This was caused by a change up on our git account.

You can see the url that git is currently using by opening the 'config' file in the .git folder. You'll see it under the '[remote "origin"]' section.

Luckily this is pretty trivial to fix. You can either update the url directly in the config file, or run the following command...

git remote set-url origin new.git.url/xyz
Enter fullscreen mode Exit fullscreen mode

Comments 0 total

    Add comment