git钩子后接收不工作 [英] git hook post-receive not working

查看:417
本文介绍了git钩子后接收不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用Git部署一些PHP代码到服务器。我正在使用GoDaddy服务器。我已经创建了裸机存储库。在钩子文件夹中,我创建了一个 post-receive 文件,并在其中写下面的代码。

 #!/ bin / sh 
GIT_WORK_TREE = / home / domain / public_html / website git checkout -f

我想让git repo将源代码移动到的public_html 。我将权限更改为 0775



但是,我的网站目录仍然保持为空。我应该怎么办?

解决方案

也许是因为你拼写了 post-recieve 错了?应该是 post-receive (注意c和c之后的i和e。


I trying to deploy some PHP code to the server with Git. I am using a GoDaddy server. I have created the bare repository. In the hooks folder, I created a post-receive file and wrote the following code in it.

#!/bin/sh
GIT_WORK_TREE=/home/domain/public_html/website git checkout -f

I want the git repo to move the source code that I have just pushed to the website directory in public_html. I changed the permission to 0775.

However, my website directory still remains empty. What should I do?

解决方案

Perhaps it's because you spelled "post-recieve" wrong? It should be post-receive (note the i and e after the c).

这篇关于git钩子后接收不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆