GitLab 搭建及 svn2git 保留原提交记录

背景:在学校做的项目都是使用SVN版本管理,遂研究了如何本地搭建GitLab,并且成功搭建在306实验室。laudukang,2017年11月20日14:01:53。

svn2git

updated by laudukang at 2017-11-20 14:10:57
1
2
3
4
5
6
7
8
9
10
cd svn_repertory
#generate author.txt config
svn log --quiet | grep -a -E "r[0-9]+ \| .+ \|" | cut -d'|' -f2 | sed 's/^ //' | sort | uniq

git svn clone <your-svn-url> --trunk="trunk" --branches="branches" -A /d/author.txt --follow-parent --username laudukang (--password <your-password> 可选)

git branch -r
git checkout -b master remotes/your-branch

git push -u origin --all && git push -u origin --tags

reference:

  1. Migrating from Subversion to Git with svn2git on Windows
  2. Migrating from SVN to GitLab
  3. Converting A 5-Year-Old Repository From Subversion To Git
  4. Checkout remote branch using git svn
  5. Work-around for failing “git svn clone” (requiring full history)
  6. git-svn