1、创建用户映射文件 users.txt
users文件内容:
<svn用户名> = git用户名<email>
eg: android = android <android@163.com>
代码创建
需要svn-migration-scripts.jar工具包支持,下载地址https://bitbucket.org/atlassian/svn-migration-scripts/downloads/
执行代码:java -jar svn-migration-scripts.jar authors svn地址 > users.txt
2、svn to git
在users.txt同级目录新建放git的文件目录,如SvnToGit文件目录
git svn clone svn地址 --authors-file=users.txt --no-metadata SvnToGit 耐心等待,全程保持网络畅通
遇到的坑:
Q: ** not defined in users.txt file ------- 将**加入users.txt
eg. Author: (no author) not defined in authors file
A: 在users.txt中加入(no author) = No Author <no.author@mail.com>