版本控制器之SVN
超详细的SVN版本控制器
简介
SVN是subversion的缩写,是一个开放源代码的版本控制系统,通过采用分支管理系统的高效管理,简而言之就是用于多个人共同开发同一个项目,实现共享资源,实现最终集中式的管理。
安装
-
安装 SVN
yum -y install subversion
-
创建 code 仓库
svnadmin create /var/svn/code
-
切换到code目录
cd /var/svn/code/conf/
-
设置 code 仓库账户安全
设置用户user1,vi authz
[/] user1=rw
为user1配置密码123,
vi passwd
user1=123
设置权限
vi svnserve.conf
anon-access = none auth-access = write password-db = passwd authz-db = authz realm = /var/svn/code
-
启动 code 版本服务(默认端口为3690,否则执行第二行代码)
svnserve -d -r /var/svn/code
或
svnserve -d -r /var/svn/code2 --listen-port 3691
-
设置 code 提交更新到 code 网站根目录的钩子脚本
1)切换到
cd /var/svn/code/hooks
2)复制cp post-commit.tmpl post-commit
3)添加执行权限chmod a+x post-commit
4)在post-commit文件最后添加以下内容vi post-commit
export LANG=en_US.UTF-8 svn up --non-interactive --username user1 --password 123 '/var/www/html'
-
在/var/www/html目录下检出code
svn co svn://192.168.197.130 ./
这里要输入root密码,用户名以及密码 -
设置 svnserve 仓库程序在 linux 服务器开机自动启动
vi /etc/rc.local
/usr/bin/svnserve -dr /var/svn/code
或
/usr/bin/svnserve -dr /var/svn/code2 --listen-port 3691
其他相关的命令
-
查看防火墙状态
systemctl status firewalld.service
(active (running))显示,说明防火墙处于激活状态 -
执行停止运行防火墙命令
systemctl stop firewalld.service
-
禁止防火墙自启动
systemctl disable firewalld.service
-
防火墙的开启
systemctl start firewalld.service
-
防火墙随系统开启启动
systemctl enable firewalld.service
-
检查启动端口
netstat -tunpl|grep svn
-
查看进程
ps -ef|grep svnserve
-
杀死所有的进程
killall svnserve
-
关闭svn服务器
systemctl stop svnserve
如有什么不足敬请各位指正!!!