svn如何迁移到git

背景

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
svn仓库doc目录结构如下:
- test
- trunk
- src
- test
- branches
- 1.0.0
- src
- test
- 2.0.0
- src
- test
- tags
- v1.0.0
- src
- test
- v2.0.0
- src
- test
- test2
- trunk
- code
- src
- test
- branches
- 1.0.0
- code
- src
- test
- tags
- 1.0.0
- code
- src
- test

将doc中的test迁移到git中

配置用户转化文件authors.txt,内容如下

1
2
3
st=Similar Su<similarsu@qq.com>
VisualSVN Server=Similar Su<similarsu@qq.com>
……

安装git-svn命令

1
sudo apt install git-svn

转化成git

1
git svn clone --trunk=/test/trunk --branches=/test/branches --tags=/test/tags --authors-file=authors.txt svn://localhost/doc test

将doc中的test2/branches/1.0.0/code 迁移到git中

执行如下命令

1
git svn clone --branches=/test2/branches/1.0.0/code --authors-file=authors.txt svn://localhost/doc code
作者

苏同

发布于

2018-08-03

更新于

2018-08-03

许可协议