svn学习笔记5(高级应用)

HOOKS钩子应用:

何为钩子?当我们执行某些特定操作时触发执行预先设定好的任务

eg:首先进入hooks文件夹 复制post-commit.tmpl文件 为post-commit 然后更改权限为可执行 chmod +x post-commit

然后打开post-commit   

svn info svn://ip/版本库名称 --xml >>  /var/www/项目文件夹

然后重启svn服务 killall svnserve    svnserve -d -r /path/repos/ 

 


 

版本库的精简与丢弃:

eg:

killall svnserve

svnadmin dump /path/repos/版本库名称   -r 版本号1:版本号2  >  /path/name

svnadmin create /path/repos/新版本库名称

svnadmin load /path/repos/新版本库名称 < /path/name 

cp -av  /path/repos/旧版本库名称/conf /*    /path/repos/新版库名称/conf 

svnserve -d -r /path/repos/

版本库迁移与switch重定向

killall svnserve

把/path/repos/版本库名称 压缩成版本库名称.zip

复制版本库名称.zip到新服务器并解压

在新服务器上运行新版本库

svn switch --relocate  svn://ip/repos/旧版本库名称   svn://ip/repos/新版本库名称

 

posted @ 2018-01-12 03:34  X__cicada  阅读(75)  评论(0编辑  收藏  举报