首先,到這裏下載 Subversion 服務端
http://subversion.tigris.org/servlets/ProjectDocumentList?expandFolder=469&folderID=8100
假設Subversion安裝路徑爲
D:/Subversion
然後下載TortoiseSVN ,它是 一個 windows下的 svn客戶端
http://tortoisesvn.net/downloads
上述兩者安裝完成後.可能你需要重啓一下電腦
然後,新建一個空文件夾,以用於作爲 Subversion 服務端 的版本庫
假設版本庫路徑爲 D:/SVNRoot/LJSvn
在LJSvn目錄,右鍵按鼠標,選擇 [TortoiseSVN] 菜單,選擇 [創建版本庫]
創建完成後,
D:/SVNRoot/LJSvn/conf/authz
就是 用戶權限列表
------------------------------------------------------------------------------
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
svnadmin = lj
# [/foo/bar]
# harry = rw
# &joe = r
# * =
[/]
lj = rw
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
------------------------------------------------------------------------------
上述紅色字爲作出的更改
把 lj 帳號設置爲可以訪問所有目錄和有 讀寫權限
D:/SVNRoot/LJSvn/conf/passwd
爲密碼設置列表
[users]
# harry = harryssecret
# sally = sallyssecret
lj = ljlj
就是表示 lj 帳號的 密碼是 ljlj
具體語法請閱讀上述兩個文件的註釋
而 D:/SVNRoot/LJSvn/conf/svnserve.conf
則是設置 全局的訪問權限
[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 = none ##說明不允許匿名訪問
auth-access = write ##登陸者可以進行寫操作
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd ##密碼數據庫使用的文件,與上面的passwd文件對應
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz ## 用戶權限庫 使用的文件,與上面的authz對應
上述都做好後,我們可以在 目標服務器上建立一個 windows服務,讓每次電腦啓動都自動啓動SVN服務
在cmd下輸入如下
sc create svnserve binpath= "D:/Subversion/bin/svnserve.exe --service -r D:/SVNRoot" start= auto displayname= "SVN Server" depend= Tcpip
若路徑失敗,可以輸入
sc delete svnserve 來刪除服務
客戶端使用菜單的 check out命令來檢出svn上的文件
例如本機檢出,則在 url 欄輸入 svn://127.0.0.1/ljsvn/ 即可