When you need to migrate or code from one repository to another, you may want to disconnect from your old repository then connect to another repository.

Here are the steps to do it.

// Remove from your current remote repository
$ git remote remove origin

// Then connect to a new repository
$ git remote add origin <new_repo_url>

// Then push your code to the new repository (optional)
$ git push -u origin master   

That’s it. Easy as it looks.

Leave a Reply

Your email address will not be published. Required fields are marked *