How To Change Git Remote Origin

To change remote origin from old to new url can use command : ‘set-url’.

Command:
git remote set-url <remote-name> <remote-url>

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

to check remote:
git remote -v