在Apache初次拉取svn代码到根目录 比如:运行后再输入用户密码 svn co svn://10.0.1.120/work/ --username jiangsq 在仓库hooks/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 WEB_PATH=/var/www/html/work SVN_USER=jsuser SVN_PASS=123456780 LOG_PATH=/tmp/svnsm.log echo date "+%Y-%m-%d %H:%M:%S" >> $LOG_PATH echo whoami,$REPOS,$REV >> $LOG_PATH echo Download_username:$SVN_USER >> $LOG_PATH $SVN_PATH/svn update $WEB_PATH --username $SVN_USER --password $SVN_PASS --no-auth-cache >> $LOG_PATH

授权: #chown +x post-commit //即可

注意:前提需要在根目录拉去一次svn代码