github server-side git hooks (i.e. pre-commit and post-commit)

久未见 提交于 2019-11-29 05:35:59

问题


I've looked around the answers on SO, and the web, and I can't see anything on how to set up a server-side git hook on github (as opposed to webhooks). Is there a way to do this?

Or alternatively, is there a way to set it up so that .git/hooks is a symlink to a part of the working tree at the time of cloning?

I should add that this is an internally-hosted github server.


回答1:


For obvious reasons, GitHub won’t allow you to execute arbitrary code on their servers as part of Git hooks. The only hooking they allow is through their webhooks or the integrated third-party services.

If you need to run some custom code, you will have to host that somewhere and set up a webhook to run it on your own server.



来源:https://stackoverflow.com/questions/22100581/github-server-side-git-hooks-i-e-pre-commit-and-post-commit

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