Centos 7svn
SVN 1.7测试
Shell> yum install subversion -y
Shell> mkdir -p /mydata/repository /etc/svnserve
Shell> cd /mydata/repository
Shell> svnadmin create project1 #建立一个项目库
Shell> cp project1/conf/* /etc/svnserve/ #利用自动生成的模板做为svn服务端的配置基础
修改整体配置文件 /etc/svnserve/svnserve.confspa
[general] anon-access = none #禁止匿名访问 auth-access = write #登陆用户能够有写权限 password-db = passwd #用户名密码的配置文件 authz-db = authz #用户权限的配置文件 realm = My Repository #仓库的说明文本
修改用户的配置文件 /etc/svnserve/passwd命令行
[users] user1 = 111 user2 = 222
修改权限的配置文件 /etc/svnserve/authzcode
[groups] admin = user1,user2 #用户组,建议全部用户都配置到组以方便权限管理 [/] #根目录下全部用户都没有权限 * = [/project1] #project1项目,admin组的用户有读写权限,其余用户只读权限 @admin = rw * = r
查看下服务的信息blog
Shell> systemctl status svnserve ● svnserve.service - Subversion protocol daemon Loaded: loaded (/usr/lib/systemd/system/svnserve.service; disabled; vendor preset: disabled) Active: inactive (dead)
下面是服务配置文件/usr/lib/systemd/system/svnserve.service的内容,无特殊要求默认便可,不须要修改ip
[Unit] Description=Subversion protocol daemon After=syslog.target network.target [Service] Type=forking EnvironmentFile=/etc/sysconfig/svnserve ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $OPTIONS [Install] WantedBy=multi-user.target
须要修改的是命令行参数配置文件 /etc/sysconfig/svnserveci
OPTIONS="-r /mydata/repository --config-file /etc/svnserve/svnserve.conf"
默认端口是3690,若须要修改能够在OPTIONS中加上 --listen-port [port]get
Shell> systemctl start svnserve
Shell> systemctl enable svnserve
第一次输入用户名密码后会提示保存,之后就不须要再输入了it
若不想保存更不想总提示保存,那就每一个svn命令都加上这三个参数:--username user1 --password 111 --no-auth-cache
Shell> svn co svn://127.0.0.1/project1 ./project1
Shell> cd project1/
Shell> touch 1.txt
Shell> svn add 1.txt
Shell> svn ci . -m 'add 1.txt'
Shell> echo 111 >> 1.txt
Shell> svn ci . -m '修改 1.txt'
Shell> svn log 1.txt
------------------------------------------------------------------------
r2 | user1 | 2019-03-18 17:26:22 +0800 (一, 2019-03-18) | 1 行
修改 1.txt
------------------------------------------------------------------------
r1 | user1 | 2019-03-18 17:25:19 +0800 (一, 2019-03-18) | 1 行
add 1.txt
------------------------------------------------------------------------
over