Git - post-receive hook with git pull "Failed to find a valid git directory"

Posted by ludicco on Server Fault See other posts from Server Fault or by ludicco
Published on 2010-01-29T16:44:44Z Indexed on 2010/03/16 14:26 UTC
Read the original article Hit count: 669

Filed under:
|
|
|

It's very weird but when setting a git repository and creating a post-receive hook with:

echo "--initializing hook--"
cd ~/websites/testing
echo "--prepare update--"
git pull
echo "--update completed--"

the hook runs indeed, but it never manage to run git pull properly:

6bfa32c..71c3d2a  master -> master
--initializing hook--
--prepare update--
fatal: Not a git repository: '.'
Failed to find a valid git directory.
--update completed--

so I'm asking myself now, how it's possible to make the hook update the clone with post-receive?

in this case the user running the processes is the same, and its everything inside the user folder so I really don't understand...because if if I go manually into

cd ~/websites/testing
git pull

it works without any problem...

any help on that would be pretty much appreciated

Thanks a lot

© Server Fault or respective owner

Related posts about unix

Related posts about git