0

我正在将一个 SVN 项目迁移到 Git。SVN 项目在存储库中具有以下结构。

/trunk
/branches
/tags

因为我希望主干充当主分支,其他分支充当普通 git 分支,标签充当 git 标签。

我在命令下运行

 git svn clone --stdlayout <svn-repo-url>

也试过

 git svn clone <svn-repo-url> -T trunk -b branches -t tags

对于上述两个命令,我收到以下错误:

fatal: .git\svn\refs\remotes\origin\https;C:\Softwares\Git\index: index file open failed: Invalid argument 
        (in cleanup) update-index -z --index-info: command returned error: 128 
W: +empty_dir: branches/<svn-repo-url>/branches 
fatal: Unable to create '<my-git-working-directory>/.git\svn\refs\remotes\origin\https;C:\Softwares\Git\index.lock': Invalid argument 

如果我在命令下面运行

git svn clone --trunk=/trunk --branches=/branches --tags=/tags <svn-repo-url>

我收到以下错误

svn-remote.svn: remote ref '/Users/<user-id>/AppData/Local/Programs/Git/trunk:refs/remotes/origin/trunk' must start with 'refs/'

请帮忙

4

2 回答 2

-1

因为,作为我工作的一部分,我已经执行了许多 SVN 到 GIT 的迁移,所以我为它创建了一个包装工具:

https://github.com/tikalk/tikal-alm-tools/tree/master/scm-tools/scm-migration/manual/SVN2GIT

也可以私信我

于 2016-09-15T11:53:12.413 回答
-2

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

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

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

于 2016-09-15T11:44:42.430 回答