Search code examples
laravelgitshared-hosting

git post-receive hook error laravel on git pull command


Trying to do git pull a directory with a post-receive script. Currently all my script does is the following:

echo 'Testing post-receive hook'
cd ~/www/test.com/laravel
pwd
git pull
cp -a ~/www/test.com/laravel/public/. ~/www/test.com/public_html/

the problem is that when I hit this script it returns remote: fatal: not a git repository: '.' however, if I manually go into ~/www/test.com/laravel and do a git pull it works? any ideas would be very helpful.


Solution

  • Answer found git post-receive not working correctly You have to Unset the git directory with unset GIT_DIR before you call git pull