Go to the Hooks directory
[[Email protected] default]# cd /opt/svn[[email protected] svn]# lltotal 4drwxr-xr-x 6 root root 4096 Feb 24 06:38 repos[[email Protected] svn]# cd repos[[email protected] repos]# lltotal 24drwxr-xr-x 2 root root 4096 Feb 24 07:47 confdrwxr-sr-x 6 root root 4096 feb 24 08:01 db-r--r--r-- 1 root root 2 Feb 24 06:31 formatdrwxr-xr-x 2 root root 4096 Feb 24 07:24 hooksdrwxr-xr-x 2 root root 4096 feb 24 06:31 Locks-rw-r--r-- 1 root root 229 feb 24 06:31 readme.txt[[email protected] repos]# cd hook-bash: cd: hook: no such file or directory[[email protecteD] repos]# cd hooks[[email protected] hooks]# lltotal 40-rwxrwxrwx 1 root root 138 feb 24 07:21 post-commit-rw-r--r-- 1 root root 1977 feb 24 06:31 post-commit.tmpl-rw-r--r-- 1 root root 1638 feb 24 06:31 post-lock.tmpl-rw-r--r-- 1 root root 2289 feb 24 06:31 post-revprop-change.tmpl-rw-r--r-- 1 root root 1567 feb 24 06:31 post-unlock.tmpl-rw-r--r-- 1 root root 3426 feb 24 06:31 pre-commit.tmpl-rw-r--r-- 1 root root 2410 Feb 24 06:31 pre-lock.tmpl-rw-r--r-- 1 root root 2786 feb 24 06:31 pre-revprop-change.tmpl-rw-r--r-- 1 root root 2100 feb 24 06:31 pre-unlock.tmpl-rw-r--r-- 1 root root 2780 feb 24 06:31 start-commit.tmpl[[email protected] hooks]#
Under normal circumstances there is no Post-commit file, I have added here.
Post-commit File Code
#!/bin/shexport lang=zh_cn. utf-8web=/home/wwwroot/defaultsvn update $WEB --username ningyuqiao --password ningyuqiao --no-auth-cache~ ~
Include the site root directory, svn a username and password.
Then give Post-commit execute permission, I gave 777 directly.
Then go to the site root directory
SVN checkout svn://IP address. #输入ip地址, and notice that there's a. Represents the current directory
This is basically done, we have a question to leave a message.
The SVN file synchronizes to the Web server, which is synchronized to the Web site root directory