How to move git repository with all branches from

2019-01-09 20:36发布

What is the best way to move a git repository with all branches and full history from bitbucket to github? Is there a script or a list of commands I have to use?

9条回答
Bombasti
2楼-- · 2019-01-09 21:15

I had the reverse use case of importing an existing repository from github to bitbucket.

Bitbucket offers an Import tool as well. The only necessary step is to add URL to repository.

It looks like:

Screenshot of the bitbucket import tool

查看更多
我想做一个坏孩纸
3楼-- · 2019-01-09 21:16

http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/

This helped me move from one git provider to another. At the end of it, all the commits were in the destination git. Simple and straight forward.

git remote rename origin bitbucket
git remote add origin https://github.com/edwardaux/Pipelines.git
git push origin master

Once I was happy that the push had been successful to GitHub, I could delete the old remote by issuing:

git remote rm bitbucket
查看更多
▲ chillily
4楼-- · 2019-01-09 21:26

It's very simple.

Create a new empty repository in GitHub (without readme or licesne, you can add them before) and the following screen will show

Inside to import code option you paste your bitbucket URL's repo and voilà!!

Click in import code

查看更多
登录 后发表回答