Let say you mirror your repository from gitlab to github or vs versa. You can re-clone your code from the new place.
But there is a better and faster way. First it is good idea to view your current config …
git remote -v
Then to do the change do something like this :
git remote set-url origin git@new_repo.com/something/blah.git
Now check if it changed :
git remote -v