配置详情:
创建svn版本库
mkdir /var/svn #我这里把版本库放在了var目录下的svn文件夹,方便管理
svnadmin create /var/svn/repo0 #我这里将svn作为所有版本库的目录,并创建了一个名为repo0的版本库
配置当前的版本库
创建版本库后,在当前版本库目录中会生成下面的文件,其中我们关心的是配置文件。
[root@localhost svn]# ls
repo0
[root@localhost svn]# cd repo0
[root@localhost repo0]# ls
conf db format hooks locks README.txt
[root@localhost repo0]# pwd
/var/svn/repo0
[root@localhost repo0]# cd conf
[root@localhost conf]# ls -a
. .. authz passwd svnserve.conf
说明:
(1)svnserve.conf: svn服务综合配置文件。
(2)passwd: 用户名口令文件。
(3)authz: 权限配置文件。
修改passwd文件
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
# harry = harryssecret
# sally = sallyssecret
repouser0 = user0passwd
rock=rockpasswd
其中对应的是 用户名=密码 ,其中等号两边的空格不是必须的。
4.2修改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
team0=erpouser0 #将上面创建的分成两个组
team1=rock
# [/foo/bar]
# harry = rw
# &joe = r #上面的别名定义在这里实现 &在这里理解为指针就很容易了
# * =
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[repo0:/]
@team0=r
@team1=rw
# 第一个小组只有读取的权限,第二个小组有读写的权限
# 单个版本库的权限配置在这个文件中实现
修改svnserve.conf
vim 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
se 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
停止和启动svn
启动svn
svnserve -d -r /var/svn/
关闭svn
ps -aux |grep svn
kill -9 进程id
导入工程
$ mkdir MyProject
$ mkdir MyProject/trunk
$ mkdir MyProject/branches
$ mkdir MyProject/tags
svn import MyProject svn://192.168.1.109/repo0/MyProject -m "first import project"
导出工程
svn co svn://192.168.1.109/repo0/MyProject
广州红莓云公司其他产品:可点击!!
定制型企业集团官网建站(PC端,移动端,微信端展示型官网定制,强大后台,自定义便捷)
定制型电子商务单用户商城(电子商城,支持PC,各种移动设备,唯品会类型)
定制型多用户可入驻商城(超强仿京东,支持多用户入驻,打开产品多元化,增加商户租赁模式)
定制型微信多用户商城(主流强推广型商城,支持入驻,三级分销,打开营销洪流)
品牌LOGO商标设计注册(定制个性化标签,建立品牌价值基础)
广州红莓云公司所有产品618.年中大促,五折开售!
点击查看广州红莓云公司所有产品