项目迁移记录:svn  to gitlab

JerryXia 发表于 , 阅读 (26)

补充

上面是最基本的一个方式。下面补充一些其他内容,不翻译了。

Optionally, prepare an authors file so svn2git can map SVN authors to Git authors. If you choose not to create the authors file then commits will not be attributed to the correct GitLab user. Some users may not consider this a big issue while others will want to ensure they complete this step. If you choose to map authors you will be required to map every author that is present on changes in the SVN repository. If you don’t, the conversion will fail and you will have to update the author file accordingly. The following command will search through the repository and output a list of authors.

svn log --quiet | grep -E "r[0-9]+ \| .+ \|" | cut -d'|' -f2 | sed 's/ //g' | sort | uniq

Use the output from the last command to construct the authors file. Create a file called authors.txt and add one mapping per line.

janedoe = Jane Doe <janedoe@example.com>johndoe = John Doe <johndoe@example.com>

If your SVN repository is in the standard format (trunk, branches, tags, not nested) the conversion is simple. For a non-standard repository see svn2git documentation. The following command will checkout the repository and do the conversion in the current working directory. Be sure to create a new directory for each repository before running the svn2git command. The conversion process will take some time.

总结

迁移过程中,从技术角度来说是非常简单的,遇到点小bug,调调就行了,再说了有运维在,怕什么。

关键是在一些业务角度上的变更,比如说迁移后的项目如何命名,怎么使用上线脚本,目录结构怎么改变,这些乱七八糟的。

参考

svn2git主页:https://github.com/nirvdrum/svn2git


2016-07-26 11:34:16 hzct

作者:dantezhao | 简书 | CSDN | GITHUB 文章推荐:http://dantezhao.com/readme 个人主页:http://dantezhao.com 文章可以转载, 但必须以超链接形式标明文章原始出处和作者信息