将SVN代码库迁移到Bitbucket

4

如何在Linux上将SVN存储库迁移到Bitbucket的逐步说明。

我有一些在SVN中的存储库,我想将它们移动到Bitbucket,如果有人知道如何通过Linux命令来完成这个过程,我会非常感激,这样我就可以将其转化为脚本。

非常感谢!


2
Bitbucket托管git和Mercurial存储库,因此您必须决定是否使用git或hg。那么为什么会有“github”标签呢? - phd
1
你想把一个 SVN 仓库迁移到 Git 仓库,然后将 Git 仓库推送到 Bitbucket 吗? - Marina Liu
@MikeShobes 我添加了将svn仓库迁移到git的方法,你可以试一下。 - Marina Liu
@MarinaLiu-MSFT 非常感谢!!我可以使用“svn checkout”吗? - Mike Shobes
@MikeShobes 不好意思,svn checkout 命令无法将 svn 仓库迁移到 git。 - Marina Liu
显示剩余2条评论
1个回答

7
您可以使用git svn clone命令将svn仓库迁移到git仓库。具体步骤如下:
git svn clone <URL for svn repo>
# besides you can use --trunk, --branches and --tags etc for git svn clone command
# may be asked to enter SVN credentials

# after first creating the repo in bitbucket...
cd reponame
git remote add origin <bitbucket repo URL>
# you may also need to "git pull --allow-unrelated-histories" to merge you new local branch with the remote
# you may need to do a "git branch --set-upstream-to=origin/master"
# you may also need to another "git pull --allow-unrelated-histories" to merge you new local branch with the remote
git push origin --all

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接