如何从bitbucket到github的所有分支移动git存储库?

本文翻译自:How to move git repository with all branches from bitbucket to github?

What is the best way to move a git repository with all branches and full history from bitbucket to github? 将所有分支和完整历史从bitbucket移动到github的git存储库的最佳方法是什么? Is there a script or a list of commands I have to use? 是否有脚本或命令列表我必须使用?


#1楼

参考:https://stackoom.com/question/1Y78P/如何从bitbucket到github的所有分支移动git存储库


#2楼

You can refer to the GitHub page " Duplicating a repository " 您可以参考GitHub页面“ 复制存储库

It uses: 它用:

That would give: 这会给:

git clone --mirror https://bitbucket.org/exampleuser/repository-to-mirror.git
# Make a bare mirrored clone of the repository

cd repository-to-mirror.git
git remote set-url --push origin https://github.com/exampleuser/mirrored
# Set the push location to your mirror

git push --mirror

As Noted in the comment s by LS : 正如LS 的评论中所述


#3楼

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

This helped me move from one git provider to another. 这帮助我从一个git提供者转移到另一个。 At the end of it, all the commits were in the destination git. 最后,所有提交都在目标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: 一旦我对GitHub的推送成功感到高兴,我可以通过发出以下命令删除旧的遥控器:

 git remote rm bitbucket 

#4楼

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 在GitHub中创建一个新的空存储库(没有自述文件或licesne,您可以在之前添加它们),以下屏幕将显示

Inside to import code option you paste your bitbucket URL's repo and voilà!! 在里面导入代码选项你粘贴你的bitbucket URL的repo和voilà!!

单击导入代码


#5楼

In case you couldn't find "Import code" button on github, you can: 如果您在github上找不到“导入代码”按钮,您可以:

  1. directly open Github Importer and enter the url . 直接打开Github Importer并输入url It will look like: 它看起来像: github importer的屏幕截图
  2. give it a name (or it will import the name automatically) 给它一个名字(或者它会自动导入名字)
  3. select Public or Private repo 选择PublicPrivate仓库
  4. Click Begin Import 单击Begin Import

UPDATE: Recently, Github announced the ability to " Import repositories with large files " 更新:最近,Github宣布了“ 导入大文件存储库 ”的能力


#6楼

I had the reverse use case of importing an existing repository from github to bitbucket. 我有一个将现有存储库从github导入bitbucket的反向用例。

Bitbucket offers an Import tool as well. Bitbucket也提供导入工具 The only necessary step is to add URL to repository. 唯一必要的步骤是将URL添加到存储库。

It looks like: 看起来像:

bitbucket导入工具的屏幕截图

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值