You can safely update the remote URL using this command:
git remote set-url origin <new-URL>
I’ve done this many times when moving between local, staging, or production remotes. It doesn’t affect your commit history at all, just tells Git where to fetch/push from now. You can verify it worked with git remote -v
.