服务器项目附录下执行:
svn checkout svn://IP地址/文件名
1.在svn版本库目录/opt/svn/svnrepos下,打开hooks ,然后cp post-commit.tmpl post-commit创建post-commit文件
2.vim post-commit 写:
#!/bin/sh
REPOS="$1"
REV="$2"
export LC_ALL="zh_CN.UTF-8"
export LANG="en_US.UTF-8"
SVN_PATH=/usr/bin #svn安装路径不用改
WEB_PATH=/home/wwwroot/***** #web项目所在
SVN_USER=huangdi #svn用户名
SVN_PASS=huangdi #svn密码
LOG_PATH=/tmp/svn.log
$SVN_PATH/svn update $WEB_PATH || exit 1
exit 0
3.让post-commit有执行的权限:chmod 777 post-commit