首页 > 解决方案 > 如何将 Bitbucket 存储库迁移到 Github?

问题描述

我想将包含多个分支的旧 Bitbucket 存储库迁移到 Github。为此,我遵循了以下描述:

# add remote github repository
$ git remote add upstream https://github.com:USER/PROJECT.git
# push all branches <-- doesn't work
$ git push upstream master
$ git push --tags upstream

只有master分支被推送到 Github 存储库(也适用于git push --all upstream)。

为了将所有分支推送到 Github,我需要checkout单独对它们执行git push upstream.

如果没有第一个分支,我如何将所有分支推送到 Github checkout

标签: git

解决方案


您可以使用此单个命令来完成。

git push REMOTE --mirror

你可以在这里阅读更多关于它的信息


推荐阅读