1

我有以下格式的项目结构。它位于https://ip/svn/siguard/DSA/

  • 分支机构/

  • 文档/

  • 标签/

  • 树干/

我已经安装了 svn2 git 并进行了所有安装。我想使用以下命令运行迁移过程

 svn2git https://ip/svn/siguard/ --trunk DSA/trunk --branches DSA/branches --branches DSA/docs --tags DSA/tags --authors author.txt --verbose

这是输出。

Running command: git svn init **--prefix=svn/** --no-metadata --trunk='DSA/trunk' --tags='DSA/tags' --branches='DSA/branches' --branches='DSA/docs' https://141.29.113.138/svn/siguard/
Initialized empty Git repository in C:/GitMigration/DSA/.git/
Running command: git config --local --get user.name
Running command: git config --local svn.authorsfile authors.txt
Running command: git svn fetch
W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: '/svn/siguard/!svn/bc/100' path not found: Additional errors:: File not found: revision 100, path '/'DSA'
W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
This may take a while on large repositories
Checked through r100
Checked through r200
Checked through r300
Checked through r400
Checked through r500
Checked through r600
Checked through r700
Checked through r800
Checked through r900
Checked through r1000
Checked through r1100
Checked through r1200
Checked through r1300
Checked through r1400
Checked through r1500
Checked through r1600
Checked through r1700
Checked through r1800
Checked through r1900
Checked through r2000
Checked through r2100
Checked through r2200
Checked through r2300
Checked through r2400
Checked through r2500
Checked through r2600
 Checked through r2700
Checked through r2800
Checked through r2900
Checked through r3000
Checked through r3100
Checked through r3200
Checked through r3300
Checked through r3400
Checked through r3500
Checked through r3600
Checked through r3700
Checked through r3800
Checked through r3900
Checked through r4000
Checked through r4017
Running command: git branch -l --no-color
Running command: git branch -r --no-color
Running command: git config --local --get user.name
Running command: git config --local --get user.email
Running command: git checkout -f master
error: pathspec 'master' did not match any file(s) known to git.
command failed:
git checkout -f master

我不知道是什么问题。当我用谷歌搜索 svn2git 时,这个实用程序似乎一切正常。

4

1 回答 1

1

有很多称为svn2git的工具,可能最好的一个是来自https://github.com/svn-all-fast-export/svn2git的 KDE 工具。我强烈建议使用该svn2git工具。这是我所知道的最好的,并且在你可以用它的规则文件做什么方面非常灵活。

您使用的工具svn2git基于git-svn并且git-svn不是用于一次性转换存储库或存储库部分的正确工具如果您想使用 Git 作为现有 SVN 服务器的前端,这是一个很棒的工具,但对于一次性转换,您不应该使用git-svnsvn2git它更适合这个用例。

如果您不是 100% 了解存储库的历史,那么在将 SVN 存储库迁移到 Git 时,svnevereverhttp ://blog.hartwork.org/ ?p=763是一个调查 SVN 存储库历史的好工具。


尽管 git-svn (或者你的情况下是错误的 svn2git )更容易开始,除了它的灵活性之外,这里还有一些使用 KDEsvn2git而不是更优越的原因:git-svn

  • 通过(如果使用正确的),历史被重建得更好,更清晰,svn2git对于具有分支和合并等的更复杂的历史尤其如此
  • 标签是真正的标签,而不是 Git 中的分支
  • 标签包含git-svn一个额外的空提交,这也使它们不是分支的一部分,因此在fetch您提供命令之前,正常情况下不会获取它们,--tags因为默认情况下也只会获取指向已获取分支的标签。使用正确的 svn2git 标签是它们所属的地方
  • 如果您更改了 SVN 中的布局,您可以轻松地配置它svn2gitgit-svn最终您将失去历史
  • 您还可以轻松地svn2git将一个 SVN 存储库拆分为多个 Git 存储库
  • 或轻松将同一个 SVN 根目录中的多个 SVN 存储库合并到一个 Git 存储库中
  • svn2git正确的转换比使用正确的要快无数倍git-svn

有很多原因导致git-svnKDE 更差,而 KDEsvn2git更胜一筹。:-)

于 2016-11-22T12:07:51.127 回答