使用 Kerberos 进行提交后的 git-svn dcommit
我想让 git 在提交时自动将本地更改推送到上游 subversion 存储库。 SVN 存储库使用 Kerberos 进行身份验证,因此无需将密码或任何内容硬编码到提交挂钩中。
执行此操作的明显方法是将“git svn dcommit”放入提交后钩子中,但不幸的是,git 似乎在调用钩子之前剥离环境变量(例如 Kerberos 需要的 KRB5CCNAME
) 。
所以问题是:如何更改传递给提交挂钩的环境变量?
I'd like to have git automatically push local changes to the upstream subversion repo when a commit is made. The SVN repo authenticates using Kerberos, so there's no need to hardcode a password or anything into the commit hook.
The obvious way to do this is to put "git svn dcommit" into the post-commit hoook, but unfortunately, git appears to be stripping environment variables (like KRB5CCNAME
, which Kerberos needs) before calling the hooks.
So the question is: how do I change the environment variables that are passed to the commit hook?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是环境变量被盒子上的 sudo 删除——我将它添加到要保存在 /etc/sudoers 中的环境变量列表中。
事实证明这是早期 RHEL5 安装中的一个错误,现已修复。
The answer was the environment variable getting stripped by sudo on the box---I added it to list of environment variables to be preserved in /etc/sudoers.
Turns out it was a bug in earlier RHEL5 installations which has since been fixed.