作者:私语茶馆
1. Visual SVN Server部署
SVN Server部署包括:
- 创建版本仓库
- 创建用户
这些部署是通过VisualSVN Server Manager实现的,如下图:

VisualSVN Server Manager(安装后自带)
1.1.SVN 初始化配置
初始化配置包括:配置网络、配置授权、SSL Certificate、添加版本仓库、配置用户权限等,前面几种都涉及到大型企业例如DNS名称、Windows的Active Directory鉴权体系等,因为考虑到初创企业的环境,可以直接从版本仓库创建开始。
1.1.1. 版本仓库配置
版本仓库管理包括导入已有仓库和新建仓库,
(1)导入仓库的步骤:
启动 VisualSVN Server Manager
右键点击Repository节点,选择"Import eXisting respository"
(2)新建仓库的步骤
启动 VisualSVN Server Manager
右键点击Repository节点,选择"Create New respository。

新建仓库

默认参数

创建成功后的界面
1.1.2. 创建用户并授权
步骤如下:
(1)在Users下创建用户
(2)在Group下创建组,并把用户加入组中。
(3)按照Group授权

创建用户

授权
1.1.3. 导文件或目录入版本仓库
Getting Data into Your Repository | SVN Book (visualsvn.com)
(一)SVN仓库的布局建议:
分三个目录:trunk-主线,branch-分支,tag-快照

SVN建议的项目结构
可以在版本仓库上点右键,创建Project Structure

创建HomeCloud项目
导入文件到版本仓库中:
使用场景:有现有文件需要版本管理起来
工具:利用"svn import"可以把未版本管理的文件和目录导入SVN,并不需要建立working copy。
步骤1:导入本地目录

对整个目录建立版本管理

检查刚导入的目录

右键刷新可查看提交的资料
2. TortoiseSVN Client安装及使用
安装客户端:TortoiseSVN提供windows安装程序,直接点击安装程序安装即可,按要求重启机器。右键菜单会出现tortoisesvn菜单。

2)生成工作副本:在空白目录处,点右键,选择SVN checkout生成工作副本。URL填写需要生成的版本库。

Checkout生成工作副本

生成后目录的状态变化
3)修改文件并提交
修改后的文件状态会发生变化:

在修改的文件右键菜单中选择:

4)查看修改历史:文件的右键TortoiseSVN|Show log,显示如下:

5)异常状态清理
有时文件修改会出现异常状态,在目录空白处点击右键,

Clearup
6)查看历史版本
选择文件,右键菜单-tortoiseSVN|show log|选择历史版本|save revision to...
至此就可以自由使用SVN的版本管理能力了。
3.SVN的参考文档
参考文档:Getting Started | VisualSVN Server