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

将所有分支和完整的历史记录从bitbucket移动到github的最佳方式是什么? 是否有脚本或我必须使用的命令列表?


您可以参考GitHub页面“复制存储库”

它用:

  • git clone --mirror :克隆每个引用(提交,标记,分支)
  • git push --mirror :推动一切
  • 这会给:

    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
    

    正如在LS评论中指出的那样:

  • 使用MarMass描述的GitHub中的Import Code功能更容易。
    请参阅https://github.com/new/import
  • 除非 ......你的回购包括一个大文件:问题是,导入工具将失败,没有一个明确的错误信息。 只有GitHub支持才能够诊断发生了什么。

  • 这很简单。

    在GitHub中创建一个新的空存储库(没有自述文件或licesne,您可以在之前添加它们),并且以下屏幕将显示

    内部导入代码选项,你粘贴你的bitbucket网址的回购和voilà!

    点击导入代码


    如果你在github上找不到“Import code”按钮,你可以:

  • 直接打开Github Importer并输入url 。 它看起来像: github导入器的屏幕截图
  • 给它一个名字(或者它会自动导入名字)
  • 选择PublicPrivate回购
  • 点击Begin Import
  • 更新:最近,Github宣布能够“用大文件导入存储库”

    链接地址: http://www.djcxy.com/p/45187.html

    上一篇: How to move git repository with all branches from bitbucket to github?

    下一篇: Multiple GitHub Pages and custom domains via DNS