ここの開発サーバーにはベア リポジトリがあり、ドライブの別の場所にそのクローンがあります。次のように、更新後の小さなスクリプトを作成しました。
#!/bin/sh
echo Updating vhosts.git at `date` >> /root/vhosts.log
cd /usr/local/www
echo Updating `pwd` vhosts as `whoami`
OLD_GIT_DIR=$GIT_DIR
GIT_DIR=.git
git pull origin master
GIT_DIR=$OLD_GIT_DIR
apachectl restart
TortoiseGitを使用してコンピューターから裸のリポジトリにプッシュすると、期待される出力が得られます。
git.exe push "origin" master:master
Counting objects: 5, done.
Compressing objects: 100% (3/3)
Writing objects: 100% (3/3)
Writing objects: 100% (3/3), 346 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
Updating /usr/local/www vhosts as root
From /root/vhosts
* branch master -> FETCH_HEAD
Updating 0a48898..c334796
Fast forward
vhosts.conf | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
[Thu Jan 21 10:49:39 2010] [warn] module dav_module is already loaded, skipping
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
To root@bugs:vhosts.git
0a48898..c334796 master -> master
ただし、コマンドライン gitを使用して同じクローンを同じ開発サーバーに同じコマンドでプッシュすると、フックが実行されないように見えます。
C:\www\bugs_vhosts>git.exe push "origin" master:master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 320 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
To root@bugs:vhosts.git
c334796..9bedd46 master -> master
更新後のフックをトリガーするために変更する必要がある設定または何かがあるかどうか、誰かが知っていますか?