如何将包含所有分支的 Git 存储库从 Bitbucket 移动到 GitHub? [英] How can I move a Git repository with all branches from Bitbucket to GitHub?
本文介绍了如何将包含所有分支的 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
:克隆每个引用(提交、标签、分支)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
As Noted in the comments by L S:
- 使用
Import Code
来自 GitHub 的功能 更容易使用 MarMass.
请参阅 https://github.com/new/import - 除非...您的存储库包含一个大文件:问题是,导入工具将失败而没有明确的错误消息.只有 GitHub 支持 能够诊断发生了什么.
- 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屋!
查看全文