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就存在前置空格,會導致這個錯誤。
要避免出現這個錯誤,應該在去掉這些行前的#時,也要順手去掉前面的空格.