最近在作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