What user runs the git hook?

Posted by Jasie on Stack Overflow See other posts from Stack Overflow or by Jasie
Published on 2010-04-13T04:26:53Z Indexed on 2010/04/13 4:32 UTC
Read the original article Hit count: 393

Filed under:

I have a post-update hook on my server, such that when I

git push

it does a pull on the live web directory. However, while the push always succeeds, the post-update hook sometimes fails.

The hook is pretty simple:

#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
cd /var/www
env -i git pull

I'm pushing updates from a variety of places, but sometimes I have to login as root on the server and manuall do a

env -i git pull

I only have to do it 20% of the time though. Any ideas why it would fail randomly? Thanks!

© Stack Overflow or respective owner

Related posts about githooks