最近在作svn迁移到gitlab,因为以前一直是由svn作版本控制。最简单的方式是将svn的内容export出来,而后添加到gitlab便可。可是,若是svn用的时间很长了,并且不少commit,咱们但愿保存svn commit的信息以便作版本的控制和比较。幸亏git提供了相应的解决办法。html
- 已安装git
- 已安装gitlab
yum install -y git-svn
git
svn帐号=git帐号名称<username@mail.com>
git svn clone svn://ip端口/projectname --no-metadata --authors-file=users.txt --trunk=trunk projectname cd projectname
git remote add origin git@xxx.xxx.xxx.xxx:root/projectname.git
git push -u origin master
参考文档:svn
- http://blog.163.com/pjt_ren/blog/static/188250602013101102615844/
- http://www.lovelucy.info/codebase-from-svn-to-git-migration-keep-commit-history.html