SVN服务器的创建

0.安装Subversion

可在http://subversion.tigris.org下载。

1.选定一个目录(例如:E:\SvnRepository)作为版本库的根目录。

2.创建自己项目的版本库(例如ProjTest),有两种方法:

a.用命令行创建版本库

svnadmin create --fs-type fsfs ProjTest

b.用TortoiseSVN创建版本库

在E:\SvnRepository目录下建立文件夹,命名为ProjTest,进入此文件夹,右键选择TortoiseSVN → 在此创建版本库...

3.本机模式使用此版本库

svn路径为:file:///E:/SvnRepository/ProjTest
本机模式,默认是允许匿名用户读写的。

4.网络使用此版本库

在Subversion中包含一个轻型的独立服务器svnserve,可以注册为Windows服务,具体方法如下:

a.安装svn服务:

@echo off
set BinPath=\"D:\Program Files\Subversion\bin\svnserve.exe\"
set RepositoryRootPath="E:\SvnRepository"
set DisplayName="Subversion Service"

sc create svnserve binPath= "%BinPath% --service --root %RepositoryRootPath%" DisplayName= %DisplayName% depend= tcpip start= auto
sc description svnserve "版本库(基于Subversion)"
net start %DisplayName%

b.启动服务:

@echo off
net start "Subversion Service"

c.停止服务:

@echo off
net stop "Subversion Service"

d.卸载服务:

@echo off
net stop "Subversion Service"
sc delete svnserve

svn路径为:
svn://localhost/ProjTest

e.用户与权限设置

e.1 修改版本库目录的conf/svnserve.conf文件

[general]
#none禁止访问;read可读;write可读写
#匿名,禁止访问

anon-access = none

#验证通过的用户,可读写
auth-access = write

#指定用户名,密码存储在本目录下的passwd中
password-db = passwd
 

e.2 在passwd文件中添加用户名和密码,格式如下

[users]
user1 = password1

 

文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
收藏我吧收藏到网摘:
相关日志:
评论: 0 | 引用: 0 | 查看次数: 274
发表评论
你没有权限发表评论!