'Switch remote origin to mirrored repo w/o recloning

I have git repo in Stash which is mirrored to Gitlab.

How do I switch my local repo to use the mirrored Gitlab ?

So i dont have to re-clone the repo.

git


Solution 1:[1]

The association between your local repository and another one somewhere else is called a "remote". Remotes can be configured at will with the git remote command; the full documentation is here.

Most likely, you want to change the existing remote named "origin" (which was created by default when you cloned) to point at the URL of the Gitlab repo. That will look something like this:

git remote set-url origin [email protected]/something/something

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 IMSoP