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
阅读更多

svn备份迁移

背景

1
2
3
4
5
6
7
8
9
需要将10.1.1.1主机上的svn仓库迁移到10.1.1.2主机上
10.1.1.1上svn结构如下:
E:/svnrepo
---firstrepo
---secondrepo
---thirdrepo

10.1.1.2上结构如下:
F:/svnrepo

注意:将svn相关命令配置到环境变量中

备份

进入10.1.1.1的E:/svnrepo

导出仓库firstrepo

1
svnadmin dump firstrepo > F:/firstrepo.dump
阅读更多

svn限制必须填写log message才能提交更新(window)

在svn服务端的仓库的hook目录下添加pre-commit.bat文件,内容如下

1
2
3
4
5
6
7
8
9
10
11
12
13
@echo off
setlocal
set REPOS=%1
set REV=%2
set svnlook="D:\Program Files\VisualSVN Server\bin\svnlook.exe"(改为自己的目录)
rem check that logmessage contains at least 10 characters
%svnlook% log "%REPOS%" -t "%REV%" | findstr ".........." > nul
if %errorlevel% gtr 0 goto err
echo 提交的log信息要大于10个字符,请重新提交!1>&2
exit 0
:err
echo 提交被阻止,请填写关于此次修改的log信息(需大于10个字符),然后再重新提交! 1>&2
exit 1