svn使用

目录

安装

yum install subversion

配置

建立版本库脚本

#!/bin/bash
svnname=$1

[ -z $svnname ] && exit 1

svnRepos="/data/svn_repos/"
sourcepath="/data/source_workcopy/"

svnadmin create ${svnRepos}${svnname}
mkdir -p  ${sourcepath}${svnname}

rm -f ${svnRepos}${svnname}/conf/passwd
ln -s ${svnRepos}passwd ${svnRepos}${svnname}/conf/passwd

cat >>${svnRepos}${svnname}/conf/authz <<EOF
[/]
userName=rw
EOF

sed -e 's/.*anon-access.*$/anon-access=none/g' \
    -e 's/# auth-access/auth-access/g' \
    -e 's/# password-db/password-db/g' \
    -e 's/# authz-db/authz-db/g' \
    -e 's/# realm = My First Repository/realm='${svnname}'/g' -i ${svnRepos}${svnname}/conf/svnserve.conf

#执行 createsvn.sh repoName 创建版本库

启动svn

svnserve -d -r /data/svn_repos/ --listen-port 9898

svn提交代码

svn commit

目录