git post-receive hook not running

后端 未结 6 1969
被撕碎了的回忆
被撕碎了的回忆 2020-12-25 12:23

I have a bare repo server-side, and I am able to successfully commit and push from my local machine. However, the post-receive hook is not running. Details:

  • Us
6条回答
  •  一向
    一向 (楼主)
    2020-12-25 12:55

    In order for a Git hook to run, it needs to have permissions set to allow it to be executable. If a hook doesn't seem to be running, check the permissions, and make sure it's executable. If it isn't you can make all hooks executable like this:

    chmod ug+x .git/hooks/*
    

    ...or if you want to make a single hook (eg. post-receive) executable:

    chmod ug+x .git/hooks/post-receive
    

    (Thanks to this post)

提交回复
热议问题