我有以下格式的项目结构。它位于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时,这个实用程序似乎一切正常。
答案 0 :(得分:1)
有一些称为svn2git
的简单工具,最好的工具是来自https://github.com/svn-all-fast-export/svn2git的KDE工具。我强烈建议您使用svn2git
工具。这是我所知道的最好的,它可以非常灵活地使用它的规则文件。
您使用的svn2git
基于git-svn
而git-svn
不是用于存储库或存储库部件的一次性转换的正确工具。如果您想将Git用作现有SVN服务器的前端,这是一个很棒的工具,但对于一次性转换,您应该不使用git-svn
,但svn2git
是更适合这种用例。
如果您不是100%关于存储库的历史记录,那么http://blog.hartwork.org/?p=763中的svneverever
是一个很好的工具,用于在将SVN存储库迁移到Git时调查其历史记录。
即使git-svn(或你的情况下错误的svn2git)更容易入手,这里还有一些原因,除了它的灵活性之外,使用KDE svn2git
而不是git-svn
更优越的原因:
svn2git
重建得更好更清洁(如果使用了正确的历史记录),对于更复杂的分支和合并历史记录来说尤其如此,等等git-svn
标记包含一个额外的空提交,这也使它们不属于分支,因此正常fetch
将不会获得它们,直到您将--tags
作为命令提供给默认情况下,仅提取指向已获取分支的标记。正确的svn2git标签是他们所属的地方svn2git
轻松配置,git-svn
最终会丢失历史记录svn2git
您还可以轻松地将一个SVN存储库拆分为多个Git存储库svn2git
比使用git-svn
git-svn
更糟糕且KDE svn2git
优越的原因有很多。 : - )