2006-05-30

Subversion windows平台使用手记

Subversion windows平台使用手记

服务端:svn-1.3.1-setup.exe
客户端:TortoiseSVN-1.3.3.6219-svn-1.3.1.msi
将服务端进程包装成windows服务的辅助工具:SVNService.exe


1、安装svn-1.3.1-setup.exe到D:\Subversion
2、安装TortoiseSVN-1.3.3.6219-svn-1.3.1.msi到D:\TortoiseSVN
3、将SVNService.zip解压后的SVNService.ext拷贝到D:\Subversion\bin下
4、建立仓库,在F:\svn目录中点鼠标右键 TortoiseSVN -> Create repository here... -> Native filesystem(FSFS) ok,将创建仓库目录文件结构
5、将SVN安装为windows服务,在命令行下进入D:\Subversion\bin目录,运行SVNService -install -d -r F:\svn
6、设置项目目录布局
假设在 F:\tmp目录下有如下项目布局
netmanager trunk\ 主干目录
branches\ 分支目录
tags\ 标签目录
F:\tmp里在右键的TortoiseSVN中的 Import... -> URL of repository 中输入仓库目录file:///F:/svn
将netmanager做为一个项目的目录树在仓库中建好,在右键的TortoiseSVN中的 Repo browser -> URL 中输入svn://localhost/确定后即可看到所建仓库的目录树
svn://localhost
netmanager trunk\
branches\
tags\

7、设置默认的认证方式和认证用户,
F:\svn\conf\svnserve.conf中,找到下面行去掉注释
# anon-access = read
# auth-access = write

找到下面行去掉注释
# password-db = passwd

找到下面行去掉注释
# realm = My First Repository

F:\svn\conf\passwd中,段[users]下添加用户
youruser = yourpasswd

8、客户端操作
在任意空目录下,右键 -> SVN checkout... -> URL of repository 添 svn://localhost/netmanager/trunk(取得netmanager的主干版本)确定取得最新的版本,此时取到为空目录 只有.svn的隐藏目录是svn的目录(不要编辑)
建立一个文件 test.txt ,在test.txt上右键 -> TortoiseSVN -> add... 选中test.txt,ok则将文件置为added状态,再在目录中 右键 -> SVN commit... 填入在上面设置的配置的用户名和密码,提交即可。


资源:
中文官方网站:http://www.subversion.org.cn
官方网站:http://subversion.tigris.org/
客户端TortoiseSVN:http://tortoisesvn.tigris.org/
快速入门:http://www.subversion.org.cn/content/view/18/1/
中文版SVN book:http://www.subversion.org.cn/svnbook/
SVNService下载地址:http://clanlib.org/~mbn/svnservice/SVNService.zip