git pull命令上的git post接收钩子错误laravel

git pull命令上的git post接收钩子错误laravel,laravel,git,shared-hosting,Laravel,Git,Shared Hosting,正在尝试使用post接收脚本执行git拉取目录。 目前我的脚本所做的工作如下: 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/ 问题是,当我点击这个脚本时,它返回remote:fatal:不是git存储库:'.'。但是,如果我手动进入~/www/test.com/lar

正在尝试使用post接收脚本执行git拉取目录。 目前我的脚本所做的工作如下:

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/
问题是,当我点击这个脚本时,它返回remote:fatal:不是git存储库:'.'。但是,如果我手动进入~/www/test.com/laravel并执行git pull,它会工作吗?任何想法都会很有帮助。

找到答案 在调用git pull之前,您必须使用
Unset git_DIR
取消git目录 在调用git pull之前,必须使用
Unset git\u DIR
取消git目录的设置