git hook post-receive not working

萝らか妹 提交于 2019-12-12 02:32:23

问题


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?


回答1:


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




回答2:


Good point by jszakmeister. Also, the hook file has to be executable. Just do chmod +x post-receive for that.



来源:https://stackoverflow.com/questions/29510830/git-hook-post-receive-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!