简体   繁体   English

使用svn2git SVN到GIT迁移失败

[英]SVN to GIT migration failed using svn2git

I'm trying to migrate a repository from SVN to GIT using svn2git . 我正在尝试使用svn2git将存储库从SVN迁移到GIT。 It's an Open Source project, public SVN repository Url is: http://svn.verinice.org/svnroot/ . 它是一个开源项目,公共SVN存储库Url是: http//svn.verinice.org/svnroot/ Feel free to test the migration... 随意测试迁移...

SVN repository structure is: SVN存储库结构是:

  • BRANCHES 分支机构
  • TAGS TAGS
  • TRUNK 树干

I used the following command to clone this Repo: 我使用以下命令来克隆此Repo:

svn2git http://svn.verinice.org/svnroot 
  --trunk TRUNK 
  --branches BRANCHES 
  --tags TAGS

But this command only migrates only one branch and no tags at all. 但是此命令仅迁移一个分支而根本不迁移任何标记。 I used these commands to check the result: 我使用这些命令来检查结果:

[user@forge git-repo]# git branch -a
* master
  springy
  remotes/springy
[user@forge git-repo]# git tag -l
[user@forge git-repo]# 

How do I migrate all branches and tags? 如何迁移所有分支和标签? Thanks for your help! 谢谢你的帮助!

UPDATE : 更新

After using parameter --authors authors-file.txt and adding Name and Email address to git configuration svn2git works fine: 使用参数--authors authors-file.txt并将名称和电子邮件地址添加到git配置svn2git后工作正常:

 git config --global user.name "your name"
 git config --global user.email "your@email.com"

You have to add a line for every SVN user in authors-file.txt : 您必须在authors-file.txt中每个 SVN用户添加一行:

 svn-user-name = Full Name <email@address.com>

git branch -a and git tag -l now returns all branches and tags. git branch -agit tag -l现在返回所有分支和标签。

I have no experience with svn2git, but you could instead try to use git svn clone to make the switch to git. 我没有使用svn2git的经验,但你可以尝试使用git svn clone来切换到git。 Note that this will take a very long time. 请注意,这将花费很长时间。 See git help svn for more information. 有关更多信息,请参阅git help svn

Note that this will not create proper tags in git, most likely due to the difference in git and svn tags discussed on the svn2git FAQ. 请注意,这不会在git中创建正确的标记,很可能是由于svn2git FAQ中讨论的git和svn标记的不同。 Instead, the tool will create tag branches. 相反,该工具将创建标记分支。 If you want to turn these into proper tags (and since I'm assuming you won't be going back to SVN at all, this shouldn't cause any harm), there is a discussion here about how to write a script to do just that. 如果你想将这些成适当的标签(和因为我假设你会不会在所有要回SVN,这应该不会造成任何伤害),有一个讨论, 在这里了解如何编写一个脚本来执行只是。

What's important to know is that all these tools are built on top of git's native SVN support,git-svn. 重要的是要知道所有这些工具都是基于git的本机SVN支持git-svn构建的。 So one can directly use git-svn for cloning,fetching changesets and etc.., but it's better to have one single script/tool to help us do all our operations during the migration and hence the need for such tools. 因此,可以直接使用git-svn进行克隆,获取更改集等等,但最好有一个单独的脚本/工具来帮助我们在迁移过程中完成所有操作,因此需要使用这些工具。

I used svn2git wrapper script hosted on https://github.com/nirvdrum/svn2git for subversion to git migration and it helped for sure, especially when we wanted to pull changesets from our subversion repository at periodic intervals as we did not completely shutdown the subversion repo for obvious reasons. 我使用托管在https://github.com/nirvdrum/svn2git上的svn2git包装器脚本来进行git迁移的颠覆,这肯定有帮助,特别是当我们想要定期从我们的subversion存储库中提取更改集时,因为我们没有完全关闭subversion repo原因很明显。 You can go through the ruby wrapper script, migration.rb to know more. 您可以浏览ruby包装器脚本migration.rb以了解更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM