如何将git存储库与所有分支从bitbucket移动到github? [英] How to move git repository with all branches from bitbucket to github?
本文介绍了如何将git存储库与所有分支从bitbucket移动到github?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
将包含所有分支和完整历史记录的git存储库从bitbucket移动到github的最佳方式是什么?是否有脚本或我必须使用的命令列表? 您可以参考GitHub页面复制资源库
它用途:
-
git clone --mirror
:克隆每个引用(提交,标签,分支)
-
git push --mirror
:将所有内容
这样可以:
git clone --mirror https://bitbucket.org/exampleuser/repository-to-mirror.git
#制作存储库的裸镜像克隆
cd存储库到镜像。 git
git remote set-url --push origin https://github.com/exampleuser/mirrored
#将推送位置设置为您的镜像
git push --mirror
注意 LS 在评论中提供from-bitbucket-to-github / 26702623#comment81362679_22907155>:
- 使用
MarMass 描述的从GitHub导入代码
功能
请参阅 https://github.com/new/import - 除非 ...您的回购包括一个大文件:问题是,导入工具将失败,但没有明确的错误消息。只有 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?
解决方案
You can refer to the GitHub page "Duplicating a repository"
It uses:
git clone --mirror
: to clone every references (commits, tags, branches)git push --mirror
: to push everything
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 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屋!
查看全文