switch git remote code example Example: change remote url github $ git remote set-url origin https://github.com/USERNAME/REPOSITORY.git