系统:Red Hat Enterprise Linux Server release 6.5 (Santiago)
安装svn:yum install -y subversion
创建目录
mkdir -pv /svn/svndata
mkdir -pv /svn/svnpasswd
启动svn:svnserve -d -r /svn/svndata/
创建项目:svnadmin create /svn/svndata/sadoc
查看目录结构:tree /svn/svndata/sadoc/
同时过滤2个字符串
cd /svn/svndata/sadoc/conf/
egrep "\-access|\-db =" svnserve.conf
[root@test1 conf]# egrep "\-access|\-db =" svnserve.conf
# anon-access = read
# auth-access = write
# password-db = passwd
# authz-db = authz
vim svnserve.conf
anon-access= none
auth-access= write
password-db = /svn/svnpasswd/passwd
authz-db = /svn/svnpasswd/authz
移动密码文件和权限文件
mv authz /svn/svnpasswd/
mv passwd /svn/svnpasswd/
定义用户
vim /svn/svnpasswd/passwd
[users]
huhaiqing = 123
user1 = 123
user2 = 123
配置权限
vim /svn/svnpasswd/authz
[aliases]
[groups]
app_manager = huhaiqing
usergr = user1,user2
[sadoc:/] # sadoc项目名称
@usergr = r # @组名,通过组名配置权限
huhaiqing = rw
重启svnserver
pkill svnserver
svnserve -d -r /svn/svndata/
使用svn图形客户端测试
linux svn 命令使用
创建命令
mkdir sadoc
cd sadoc/
mkdir trunk branch tags
导入目录结构:svn import -m "a" sadoc/ svn://192.168.8.61/sadoc
导出目录结构:svn checkout svn://192.168.8.61/sadoc sadoc/
更新文件:svn update --force svn://192.168.8.61/sadoc sadoc/
查看目录:svn list --verbose svn://192.168.8.61/sadoc
查看文件:svn cat svn://192.168.8.61/sadoc/css/bootstrap.css
提交数据
cd sadoc
echo test>test.txt
svn add test.txt
svn ci -m "test"
本文转自1321385590 51CTO博客,原文链接:http://blog.51cto.com/linux10000/1948047,如需转载请自行联系原作者