SVN使用hook代码同步总是提示需要存储密码的解决方法

客户端修改代码提交到代码库正常,然后从代码库手动更新到目标目录也没问题。但是使用hook将代码库的更新自动同步到目标目录的时候,就老是提示需要存储密码。提示如下错误:

Warning: post-commit hook failed (exit code 1) with output:
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
lxy
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? svn: Can't read stdin: End of file found
如图所示:


解决方法一:
上面的提示信息,已经说了解决方案。是在/root/.subversion/servers文件下指明 'store-plaintext-passwords' option to either 'yes' or 'no'  可以是yes也可以是no 就是要明确指明这个option就可以了。
如果你提示的不是/root/.subversion/这个目录而是另一个目录(比如是/var/www/.subversion/)下没有servers文件,可以在~/.subversion下找到我们想要的servers这个文件。复制一份到你的目录(/var/www/.subversion/),然后编辑servers文件,加入下面的选项 :

store-plaintext-passwords = no

解决方法二:
修改代码仓库hook文件下边的自动同步文件post-commit,在执行svn更新命令的时候,加上 --no-auth-cache 。如下:
svn update /home/wwwroot/shop --username 'harry' --password 'harry' --no-auth-cache
至于如何实现代码同步参看: SVN使用钩子实现代码同步

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值