我与 git/gitolite 的斗争仍在继续。我正在尝试通过使用post-receive
钩子来设置部署网站/webapp 的方法。
基本上我有一个远程仓库,然后将其克隆到一个DocumentRoot
供 apache 服务的仓库中。我的post-receive
钩子看起来像这样:
document_root=/path/to/document/root
echo "deploying to web directory"
sudo GIT_WORK_TREE=$document_root git checkout -f
sudo chown -R apache:apache $document_root
一切都很好 - 对于第一次部署,但是 git 似乎忽略了此后的任何更改。如果我提交了add
文件,那么git push
它们会转到我的远程存储库,但不会克隆到其中DocumentRoot
,也不会给出错误。
谁能想到可能出了什么问题?