The SVN file synchronizes to the Web server, which is synchronized to the Web site root directory

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.