如何将git存储库与所有分支从bitbucket移动到github? [英] How to move git repository with all branches from bitbucket to github?

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

问题描述

将包含所有分支和完整历史记录的git存储库从bitbucket移动到github的最佳方式是什么?是否有脚本或我必须使用的命令列表? 您可以参考GitHub页面复制资源库



它用途:





这样可以:

  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>:




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:

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:

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

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