2016-08-04 121 views
3

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

首先尝试:

我也跟着在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标签似乎位于

.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

=>这个结果是完全无用。

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

回答

1

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

SubGit具有进口提供免费优惠,而且通常比git svn更加完整。

+0

谢谢,我会试试看。 –

+0

子文件导入工作正常(并且比git svn快得多)。 感谢您的帮助。 –