简体   繁体   中英

Migrated master repo from Bitbucket to Github. How to reconnect cloned repo to new Github repo?

Pretty straight forward. I have an app running on a local server that was cloned from a Bitbucket repo. I moved that repo over to Github and was wondering if there was a way to connect my cloned repo to the new Github repo? Or do I have to delete the cloned repo and make a clone?

Add a new remote that points to the new repo or change the url for the remote that you have already set to have the new repo url.

git help remote

Then, add a new remote (yes, you can have more than one remote set up on a repo):

git remote add new-repo the-url
git fetch new-repo

or (assuming the old remote is called origin):

git remote set-url origin the-new-url
git fetch origin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM