如何将包含所有分支的 Git 存储库从 Bitbucket 移动到 GitHub? [英] How can I move a Git repository with all branches from Bitbucket to GitHub?

查看:38
本文介绍了如何将包含所有分支的 Git 存储库从 Bitbucket 移动到 GitHub?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将包含所有分支和完整历史记录的 Git 存储库从 Bitbucket 移动到 GitHub 的最佳方法是什么?

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?

推荐答案

可以参考GitHub页面复制仓库"

You can refer to the GitHub page "Duplicating a repository"

它使用:

那会给:

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的评论中:

As Noted in the comments by L S:

  • it is easier to use the Import Code feature from GitHub described by MarMass.
    See https://github.com/new/import
  • Unless... your repo includes a large file: the problem is, the import tool will fail without a clear error message. Only GitHub Support would be able to diagnose what happened.

这篇关于如何将包含所有分支的 Git 存储库从 Bitbucket 移动到 GitHub?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆