首页 > 解决方案 > 带有提交历史的 SVN 到 GIT 迁移(使用 git svn)

问题描述

我需要将存储库从 SVN 迁移到 GIT(Bitbiucket) 以及提交历史记录和分支。阅读并探索了几篇文章,但在尝试来自以下 url 的以下命令时卡住了: https ://davidzych.com/migrating-from-svn-to-git/

Step 1) git svn init http://url.to.svn/ --prefix svn
Step 2) git svn init http://url.to.svn/ -T Trunk -B Branches -t Tags
Step 3) git config svn.authorsfile ../authors.txt
Step 4) git svn fetch [Get stuck at this step and it doesn't move forward after a specific revision]
Step 5) git branch -a
Step 6) git tag -a -m "Migrating SVN tag" tag-name refs/tags/tag-name
Step 7) git remote add newrepo https://url.to.git/repo.git
Step 8) git push --all newrepo and git push --tags newrepo

我还尝试了以下网址中的步骤。 https://docs.microsoft.com/en-us/azure/devops/repos/git/create-new-repo?view=azure-devops

请建议是否有任何其他更好的方法/步骤来进行此迁移。

标签: gitsvnversion-controlmigration

解决方案


Bitbucket 有一个特殊的插件,称为 SVN Mirror。


推荐阅读