【发布时间】:2011-05-16 16:21:45
【问题描述】:
我的目录结构是:
~/parent.git/.git/hooks/post-receive
post-receive 钩子看起来像:
#!/bin/sh
git checkout -f
当我推入 parent.git 时,脚本没有运行。我无法弄清楚问题所在,因为互联网上的每一点都说这应该可以工作。
我 chmod'd post-receive,所以我知道这不是问题。非常感谢任何帮助。
【问题讨论】:
-
如果您在推送到非裸存储库后尝试刷新签出的文件,请参阅 Git 常见问题解答中的 “Why won't I see changes in the remote repo after "git push"?”。它建议使用更安全的post-update script。问题可能是由于 cwd 是存储库目录本身并且 GIT_DIR 设置为相同的路径。可能相关:SO question 5531309.
标签: git hook githooks git-post-receive