小编rin*_*nge的帖子

如何打开 TTY 与 git-push 钩子交互?

我正在使用 git-deploy Ruby gem 将应用程序交付到登台服务器。部署是使用 SSH 密钥执行的。

在我的after_push脚本中,我想用 运行一个命令sudo,随后要求我输入密码,因为 sudo 权限是有限的(没有密码就不能运行 sudo)。

实际上我的 sudo 命令失败了:

sudo: no tty present and no askpass program specified
Run Code Online (Sandbox Code Playgroud)

我已经尝试添加一个 askpass 程序并根据 git 手册指定它。

如何git-pushafter_push脚本中的交互式命令的过程中打开 TTY ?

ssh post-commit git-push githooks

5
推荐指数
1
解决办法
2074
查看次数

标签 统计

git-push ×1

githooks ×1

post-commit ×1

ssh ×1