【发布时间】:2013-01-12 18:59:30
【问题描述】:
我正在尝试使用接收后挂钩来更新远程服务器。我正在使用 ssh,一切正常(运行 git pull 确实拉)。我从this deploy.php 开始,其他命令,如git status,按预期运行和输出,但拉动似乎根本没有做任何事情。
我已经chowned 了所有东西(git repo、known_hosts 等),所以我的 www-data 用户应该能够访问服务器上的任何东西。有什么方法可以让我至少找到一些错误日志记录出了什么问题?
编辑:按照 adder 的建议将 git pull 更改为 git pull --verbose 后,我看不到输出有任何变化。输出仍然是:
$ whoami
www-data
$ git pull --verbose
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# deploy.php
nothing added to commit but untracked files present (use "git add" to track)
解决方案: 需要将 apache 用户设置为 ssh 到 github。我以 root 身份连接,然后当我的接收后挂钩目标无法进行相同的更新时感到困惑。我以 root 身份执行此操作,脚本以 www-data 身份运行。
【问题讨论】: