1,安装SVN服务器程序
[[email protected] ~]# yum install subversion
2,创建SVN仓库
[[email protected] ~]# mkdir /root/svn [[email protected] ~]# svnadmin create /root/svn/
3,配置仓库属性,创建用户,设置权限
3.1 配置仓库属性
[[email protected] ~]# vim /root/svn/conf/svnserve.conf # anon-access = read # auth-access = write # authz-db = authz # password-db = passwd 改为: anon-access = none auth-access = write password-db = passwd authz-db = authz
3.2 创建用户,一个一行
[[email protected] ~]# vim /root/svn/conf/passwd user1 = passwd1 user2 = passwd2
3.3 为用户授权目录,尾行添加
[[email protected] ~]# vim svn/conf/authz [/] user1 = rw user2 = rw
4,启动服务:
[[email protected] ~]# svnserve -d -r /root/svn/
5, svn客户的测试
[[email protected] ~]# mkdir test/ [[email protected] ~]# cd test/ [[email protected] test]# svn checkout svn://172.16.66.22 --username=user1 --password=passwd1 Checked out revision 0. [[email protected] test]# vim hello_world.c #include <stdio.h> int main() { printf("Hello world\n"); return 0; } [[email protected] test]# svn add hello_world.c [[email protected] test]# export SVN_EDITOR=vim [[email protected] test]# svn commit --message "李春利:提交Hello_world.c" [[email protected] test]# svn up [[email protected] test]# svn log ------------------------------------------------------------------------ r1 | user1 | 2017-09-21 14:06:34 +0800 (Thu, 21 Sep 2017) | 1 line 李春利:提交Hello_world.c ------------------------------------------------------------------------ [[email protected] test]#
时间: 2024-10-08 19:35:09