subversion
Install
# CentOS安装Subversion
yum install subversion
mkdir /var/svn/
systemctl restart svnserve# Docker安装Subversion(参考:https://github.com/garethflowers/docker-svn-server)
docker run \--name my-svn-server \--detach \--volume /home/svn:/var/opt/svn \--publish 3690:3690 \garethflowers/svn-server
Command
1、使用Docker安装Subversion(参考:https://github.com/garethflowers/docker-svn-server)
docker run \--name svn-server \--detach \--volume /home/svn:/var/opt/svn \--publish 3690:3690 \garethflowers/svn-serverdocker exec -it svn-server /bin/sh
2、进入 /var/opt/svn 仓库的根目录,创建仓库
cd /var/opt/svn
svnadmin create huangxin
3、仓库配置,修改 svnserve.conf
cd /var/opt/svn/huangxin/conf
sed -i 's/# anon-access = read/anon-access = none/' svnserve.conf
sed -i 's/# auth-access = write/auth-access = write/' svnserve.conf
sed -i 's/# password-db = passwd/password-db = passwd/' svnserve.conf
sed -i 's/# authz-db = authz/authz-db = authz/' svnserve.conf
sed -i 's/# realm = My First Repository/realm = huangxin/' svnserve.conf
4、仓库配置,修改 passwd
cd /var/opt/svn/huangxin/conf
cat <<'EOF'> passwd
[users]
admin = 123456
EOF
5、仓库配置,修改 authz
cd /var/opt/svn/huangxin/conf
cat <<'EOF'> authz
[groups]
developers = admin[/]
admin = rw[svn:/]
@developers = rw
EOF
6、克隆仓库
cd /tmp
svn checkout --username admin --password 123456 svn://127.0.0.1:3690/huangxin
7、添加代码
cd huangxin/
echo "hello,svn" > index.html
echo "hello,world" > index.html
8、将 index.html 文件添加到 Subversion 的版本控制中
svn add index.html
9、将更改(包括添加的新文件)提交到仓库
svn commit -m "新增index.html"
10、获取仓库信息(可选)
svn status
svn info
svn log
svn diff
添加用户