Skip to content

Instantly share code, notes, and snippets.

@simpleton
Forked from fengmk2/svn-to-git.md
Created February 24, 2014 08:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simpleton/9184125 to your computer and use it in GitHub Desktop.
Save simpleton/9184125 to your computer and use it in GitHub Desktop.

从 svn 迁移到 gitlab

找出所有提交者

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

手动设置对应关系 users.txt

suqian.yf = 苏千 <suqian.yf@taobao.com>
...
zhangxing_z.pt = 章星 <zhangxing_z.pt@taobao.com>
zhenghaibo.pt = 郑海波 <zhenghaibo.pt@taobao.com>

从svn clone 出来

$ git svn clone http://svnurl.com/weibo/trunk --authors-file=users.txt --no-metadata weibo

在gitlab上创建tcif项目,并添加到remotes

$ git remote add origin git@gitlab.abc.com:weibo.git

push 到 gitlab

$ git push origin --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment