Windows版
1. 正常安装subversion ,我选择安装1.4.6
2. 浏览下文件及其安装目录,在命令行中打svn help 这个是最常用的帮助
3. 接下来要安装服务
a) 第一步:生成repository,使用svnadmin 命令:先生成目录,svnadmin create d:/svnrep,关于create命令用法如下:
b) 设置repostory(import and confusing)
进入你设置的目录:
如上所示,需要对以上的三个文件进行配置,
(1)对passwd进行配置,这个文件中含有用户名和密码:
(2)对authz进行设置,
备注:有时要在 [/] 加入 *=r ,否则会“出现无权对根进行编辑”的错误
(3)对svnserve.conf设置
一般情况下可以对其进行文件指向。一个是密码,另一个是对其授权,
以上三个文件都必须设置正确,否则不能正确运行,而且svn的报错不是很全,不能准备地告诉你错误的原因。
4、启动服务:
有几个方法启动,一种是用其命令
Svnserve –d –r d:/svnroot; 以下是这些参数的含义:
第二种是将其作为一个windows服务,当然也有几种方法,一个是用sc 进行config,
运行以下命令:
sc create svnservice
binpath= "\"C:\program files\Subversion\bin\svnserve.exe\" --service -r D:\svnroot"
displayname= "SVNService"
depend= Tcpip
start= auto
常见问题:
经常有新手配置基于svnserve的subversion服务器后,
在客户端访问subversion版本库时出现这个错误:
svnserve.conf:12: Option expected
为什么会出现这个错误呢,就是因为subversion读取配置文件svnserve.conf时,无法识别有前置空格的配置文件,如
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit http://subversion.tigris.org/ for more information.
[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
anon-access = read
auth-access = write
像上面的配置文件中,anon-access是顶行的,没问题,而auth-access就存在前置空格,会导致这个错误。
要避免出现这个错误,应该在去掉这些行前的#时,也要顺手去掉前面的空格.