svn设置hooks自动提交代码到服务器

1.进入svn目录           mkdir code ( 创建一个文件夹放代码, 也可以不创建直接放svn文件夹里 )

2.进入svn目录的hooks文件夹

3.touch post-commit                //创建一个post-commit文件

4.vim post-commit                  //修改post-commit文件内容成:


#!/bin/sh
REPOS="$1"
REV="$2"  
TXN_NAME="$3"  
WEB=/home/svn/code
export LANG=en_US.UTF-8
svn update $WEB --username root --password ****

 

5. 注意,上面的代码后面不能加注释

    注意,上面的代码后面不能加注释

    注意,上面的代码后面不能加注释

6. cd 到放代码的目录, 更新一下最新内容防止出错( 否则文件不起效 )
    svn checkout svn://ip地址
    报错svn: E205000: Try 'svn help' for more info
           svn: E205000: Error parsing arguments             //svn checkout svn://ip地址  这句敲错了

7. 本地上传时报错  post-commit hook failed (exit code 255) with no output.
    解决方法一:  chmod 777 /home/svn/hooks/post-commit
    解决方法二:  检查新建的post-commit文件 #!/bin/sh 是不是复制漏了
8. 出现报错 You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in

    解决办法: 在上面代码最后一行后加--no-auth-cache

                   这样:   svn update $WEB --username root --password **** --no-auth-cache

如果还是不行去这里看看   svn钩子自动更新代码到代码库_慕课手记

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值