Home  >  Q&A  >  body text

请问 git 的 1.7.9.5 版本怎么做钩子?

我之前一般都是 hooks/下面做一个 post-receive 。并且设定权限 777

这次帮朋友的 VPS 配置 GIT 却发现根本没有 post-receive.sample 。于是我自己建立了一个 post-receive 并且想往常一样输入内容,设定权限,却发现完全不 work 。 gg 了一下,也没找到解决方案。请问有没有类似经验的同学指点一下

hooks/下面的文件如图:(post-receive是我新建的)

怪我咯怪我咯2727 days ago497

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:25:11

    pre-receive
    is executed first when the client pushes, and can be used to reject the client's push.
    update
    is similar to pre-receive, but will be executed once for each branch.
    post-receive
    Executed after the client push is completed.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-02 09:25:11

    I also asked this question, and someone gave me the answer /q/1010000004382023
    It is indeed the case... Create a new document directly to write the content, save it, and then chmod +x post-receive to ensure that it is executable...

    reply
    0
  • Cancelreply