Difference between pre-push and pre-receive hook in git?

牧云@^-^@ 提交于 2019-12-03 09:07:26
VonC

One (pre-push) is a client-side hook, the other (pre-receive) is a server-side hook.

In that aspect, they are very different, and if you want to enforce consistently a given policy, you often do it in a pre-receive (server side) hook. That way, you don't have to worry about deploying a pre-push hook on each client.

Remember: hooks are local to a repo, which means a pre-push hook cannot easily be distributed to any downstream repo. But if those downstream repos are all referring to the same upstream repo, a pre-receive hook can apply to them all.

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