SVN can use the hook function to synchronize updates to the specified directory when submitting
1. Enter the hooks directory of the repository
cd /home/svn/project1/hooks
2. Copy post-commit.tmpl as post-commit
cp post-commit.tmpl post-commit
3. Edit post-commit
#!/bin/sh export LANG=zh_CN.UTF-8 SVN=/usr/bin/svn #svn executable WEB=/home/webapp/project1 #Sync to directory LOG=/home/svn/project1_update.log #svn synchronization log export LANG=zh_CN.UTF-8 ${SVN} update --username user --password 123456 ${WEB} >> ${LOG} chmod -R 777 ${WEB}
4. Add post-commit executable permission
chmod a+x post-commit