这里是上下文:
远程裸仓库中接收后钩子的内容:
#!/bin/sh
GIT_WORK_TREE=/var/www/html git checkout -f
一切都可以在远程正常运行,但是我希望能够直接从远程服务器上的裸仓库中部署。下一步将是一个名为https的脚本,以便在SSH不可用时进行部署。
在我的本地计算机上推送:
git push origin master:master至https://github.com/Myself/repo.git
d8856273 .. e3fe4b4c 主->主
在裸仓库中,在获取之前
〜/ deploy.git $ git rev-parse --short HEAD
d885627
从远程服务器本地获取:
〜/ deploy.git $ git fetch https://github.com/Myself/repo.git master:master
来自https://github.com/Myself/repo
d885627 .. e3fe4b4 大师->大师
新内容在那里。但是,/ var / www / html保持不变。
似乎在获取后未触发接收后挂钩。我该如何解决呢?