lyl801013 发表于 2015-7-25 07:41:35

JBossWS 源代码从 SVN 迁移到 GitHub

腾讯SNG夏日招聘集结号:200个空缺岗位,JAVA、C++、云计算、Android……
  JBossWS 源代码从 SVN 迁移到 GitHub,GitHub 地址:https://github.com/jbossws。一个完整的迁移需要把 SVN 库的历史记录也迁移过去,JBossWS 团队使用GitHub importer,小的代码库很方便,但是大型库就遇到了麻烦,只能使用另外一种方式。另一种方式是基于git-svn。首先是构建一个作者映射文件,从 SVN commit 的开发者到 GitHub 用户,使用以下 bash 命令:

> svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" "}' | sort -u > authors-transform.txt

然后创建一个本地Git 库:

> git svn clone --stdlayout --no-metadata -A authors-transform.txt http://anonsvn.jboss.org/repos/jbossws/stack/cxf /tmp/rep

添加一个远程库链接,然后 push 到 master:

> git remote add origin https://github.com/jbossws/jbossws-cxf.git
> git push -u origin master

继续 push:

> printf "git push origin "; git show-ref | grep refs/remotes | grep -v '@' | grep -v remotes/tags | perl -ne 'print "refs/remotes/$1:refs/heads/$1 " if m!refs/remotes/(.*)!'; echo

> printf "git push origin "; git show-ref | grep refs/remotes/tags | grep -v '@' | perl -ne 'print "refs/remotes/tags/$1:refs/tags/$1 " if m!refs/remotes/tags/(.*)!'; echo

完成!
  更多内容请看说明。
页: [1]
查看完整版本: JBossWS 源代码从 SVN 迁移到 GitHub