Hi all.
I've got a bare repository on our development server here, and a clone of that elsewhere on the drive. I've written a small post-update script as follows:
#!/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
When pushing to the bare repo from my computer using TortoiseGit, I get the expected output:
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
However, if I use the command-line git to push the same clone to the same dev server, with the same command, even, it appears the hook does not run!
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
Does anyone know if there's a setting or something else I need to change to trigger the post-update hook?