在Windows上从svn迁移到git 2.9.2

时间:2016-08-04 07:35:55

标签: git svn version-control

在Windows 10上从svn(服务器版本1.6.11)迁移到git(版本2.9.2)似乎不像所描述的那样工作(我想保留所有svn-tags和分支)。

首先尝试:

我按照https://www.atlassian.com/git/tutorials/migrating-convert提供的教程。

结果:执行以下命令时,将删除所有分支:

java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git 
--force

接下来尝试:

我按照https://git-scm.com/book/it/v2/Git-and-Other-Systems-Migrating-to-Git

中描述的步骤进行操作
  • 结帐项目:git svn clone --stdlayout --authors-file=authors.txt --no-metadata http://<the-svn-url-without-trunk> <module-directory>

  • 签出后,git tag -l生成空输出。

  • git branch -a产生以下输出(如预期的那样):

    *master remotes/origin/tags/de-vgwort-jerry-configuration-1.0.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.0.1 remotes/origin/tags/de-vgwort-jerry-configuration-1.0.2 remotes/origin/tags/de-vgwort-jerry-configuration-1.1.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.2.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.3.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.4.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.4.1 remotes/origin/tags/de-vgwort-jerry-configuration-1.5.0 remotes/origin/trunk

根据文档的下一步:

To move the tags to be proper Git tags, run

$ cp -Rf .git/refs/remotes/origin/tags/* .git/refs/tags/
$ rm -Rf .git/refs/remotes/origin/tags

问题:

路径.git/refs/remotes/origin/tags/为空。所有的svn-tags似乎都位于

.git/svn/refs/remotes/origin/tags 

目录.git/svn/refs/remotes/origin/tags包含每个标记的子目录。我尝试将这些目录移到.git/refs/tags/,但这会在执行git branch -a时导致以下输出:

warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.0/index warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.0/unhandled.log warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.1/index warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.1/unhandled.log warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.2/index warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.0.2/unhandled.log warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.1.0/index warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.1.0/unhandled.log warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.2.0/index warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.2.0/unhandled.log warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.3.0/index warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.3.0/unhandled.log warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.0/index warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.0/unhandled.log warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.1/index warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.4.1/unhandled.log warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.5.0/index warning: ignoring broken ref refs/tags/de-vgwort-jerry-configuration-1.5.0/unhandled.log * master remotes/origin/tags/de-vgwort-jerry-configuration-1.0.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.0.1 remotes/origin/tags/de-vgwort-jerry-configuration-1.0.2 remotes/origin/tags/de-vgwort-jerry-configuration-1.1.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.2.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.3.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.4.0 remotes/origin/tags/de-vgwort-jerry-configuration-1.4.1 remotes/origin/tags/de-vgwort-jerry-configuration-1.5.0 remotes/origin/trunk

接下来尝试

使用https://github.com/nirvdrum/svn2git中的svn2git。但是这个工具似乎也不起作用。运行后

svn2git <svn-url-without-trunk> --authors ..\authors.txt

命令git branch -a产生了以下输出:

* master remotes/svn/trunk

=&GT;这个结果很没用。

我在这里缺少什么?是否有适用于Windows和最新git版本2.9.2的文档?

1 个答案:

答案 0 :(得分:1)

对于单向导入,您可以尝试subgit import

SubGit免费提供导入,通常比git svn更完整。