I have my project hosted at bitbucket. Now I am open sourcing it and want to move it to github. I have already created an empty github repository, but when I locally on my computer change the remote url to the new repo, it shows no changes and won't commit/push anything. I am clearly doing it wrong - what is the correct way of moving a project from one git repository/server to another one?
Asked
Active
Viewed 228 times
2 Answers
2
I'm assuming that your Github repository is empty.
In your local folder, add a new remote repository:
git remote add github git@github.com:<username>/<repository>.git
Alternatively, if you did not set your ssh key on Github, you should use HTTPS:
git remote add github https://github.com/<username>/<repository>.git
Push your local master branch to the Github reposiroty:
git push github master

Arthur Del Esposte
- 198
- 8
0
You will want to add the GitHub repo as a new remote to your existing local repo.
See this QA: Git: how to set remote in existing repo
You may need to do a Force Push if your new GitHub repo already has commits, and those commits will be lost.
Note that you could just set your existing BitBucket repo to public. GitHub does not have a monopoly on open-source projects.

Dai
- 141,631
- 28
- 261
- 374