简单快捷SVN2Gitlab

1.安装git-svn

  命令:yum install -y git-svn

2.获取作者名字列表

  svn co --username liquan --password liquan http://svn代码地址  code

  cd code

  svn log --xml | grep author | sort -u | perl -pe 's/.*>(.*?)<.*/$1 = /' > /root/users.txt

3.映射git用户数据

  vim /root/users.txt

  一一映射用户数据

4.把SVN仓库变成git仓库

  git svn clone http://svn代码地址 --authors-file=/root/users.txt  --no-metadata  my_project

5.将标签变为合适的git标签,运行(如果无标签可略过)

  cd my_project

  cp -Rf .git/refs/remotes/origin/tags/* .git/refs/tags/

  rm -Rf .git/refs/remotes/origin/tags

6.将refs/remotes 下剩余的引用移动为本地分支

  cp -Rf .git/refs/remotes/* .git/refs/heads/

  rm -Rf .git/refs/remotes

7.将你的服务器添加为远程仓库

  git remote add origin http://git仓库地址.git

8.传所有分支与标签

  git push origin --all

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容