进入到hooks目录
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
[root@li538-34 default] # cd /opt/svn
[root@li538-34 svn] # ll
total 4 drwxr-xr-x 6 root root 4096 Feb 24 06:38 repos [root@li538-34 svn] # cd repos
[root@li538-34 repos] # ll
total 24 drwxr-xr-x 2 root root 4096 Feb 24 07:47 conf drwxr-sr-x 6 root root 4096 Feb 24 08:01 db -r--r--r-- 1 root root 2 Feb 24 06:31 format
drwxr-xr-x 2 root root 4096 Feb 24 07:24 hooks drwxr-xr-x 2 root root 4096 Feb 24 06:31 locks -rw-r--r-- 1 root root 229 Feb 24 06:31 README.txt [root@li538-34 repos] # cd hook
- bash : cd : hook: No such file or directory
[root@li538-34 repos] # cd hooks
[root@li538-34 hooks] # ll
total 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 [root@li538-34 hooks] #
|
正常情况下没有post-commit 文件,我这里已经添加了。
post-commit 文件代码
1
2
3
4
5
6
|
#!/bin/sh export LANG=zh_CN.UTF-8
WEB= /home/wwwroot/default
svn update $WEB --username ningyuqiao --password ningyuqiao --no-auth-cache ~ ~ |
包括网站根目录,svn一个用户名和密码。
然后给post-commit 执行权限,我直接给了777。
然后进入网站根目录
1
|
svn checkout svn: // ip address . #输入ip地址,然后注意后面有个.代表当前目录
|
到此为止基本搞定,大家有问题给我留言。
本文转自ning1022 51CTO博客,原文链接:http://blog.51cto.com/ning1022/1615070,如需转载请自行联系原作者