我将使用svn2git来迁移一个仓库从SVN到GIT。这是一个开源项目,公共SVN仓库地址为:http://svn.verinice.org/svnroot/。欢迎您进行迁移测试...
SVN仓库结构如下:
SVN仓库结构如下:
- BRANCHES(分支)
- TAGS(标签)
- TRUNK(主干)
svn2git http://svn.verinice.org/svnroot
--trunk TRUNK
--branches BRANCHES
--tags TAGS
但是这个命令只迁移一个分支,而且没有标签。我使用以下命令来检查结果:
[user@forge git-repo]# git branch -a
* master
springy
remotes/springy
[user@forge git-repo]# git tag -l
[user@forge git-repo]#
如何迁移所有分支和标签?
更新:
在使用参数--authors authors-file.txt并将姓名和邮件地址添加到 git 配置后,svn2git 可以正常工作:
git config --global user.name "your name"
git config --global user.email "your@email.com"
您需要在authors-file.txt文件中为每个 SVN 用户添加一行:
svn-user-name = Full Name <email@address.com>
git branch -a 和 git tag -l 现在会返回所有分支和标签。