Bitbucket Hooks 与 Webhooks

标签 bitbucket

BitBucket 中的 hooks 和 webhooks 有什么区别?我已经阅读了两者的文档,但我似乎不明白你什么时候会使用另一个。

编辑:我阅读的文档。

https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html
https://confluence.atlassian.com/bitbucketserver/using-repository-hooks-776639836.html

最佳答案

正如 ben5556 提到的,您将 Bi​​tbucket Cloud 文档与 Bitbucket Server 文档进行比较。不过,这里还有另一个重要区别:您链接的 Bitbucket Server 文档引用了 git hooks。 ,这是 Git 的原生部分,Bitbucket Cloud 文档引用 webhooks ,这是一种基于 HTTP 的回调机制。 (为了全面披露,Bitbucket Server 也可以发送 webhook:https://confluence.atlassian.com/bitbucketserver/managing-webhooks-in-bitbucket-server-938025878.html)

您目前无法在 Bitbucket Cloud 上控制 git Hook ,但在 Bitbucket Server(您只会破坏自己的东西)上,您可以使用它们来控制 git 工作流程的不同部分。例如,在 BB 服务器上,如果某些提交在提交消息中没有票号,您可以使用 pre-receive 钩子(Hook)拒绝推送,或者您可以使用 post-receive 钩子(Hook)通知您的(人类)用户即将进行的维护。

Webhook 通常更多地用作通知方法 - 例如,您可以让 Bitbucket 通知 Slack 关于拉取请求合并,或者让 Bitbucket 通知您的 CI/CD 系统有新的提交要测试。

关于Bitbucket Hooks 与 Webhooks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52783842/

相关文章:

git - 从 Bitbucket 中删除部署 key

git - 位桶访问不起作用

git - 无法使用 VS Team Explorer(Bitbucket git) pull/获取

从本地到 bitbucket/github hub 再到实时网络服务器的 Git 工作流程

git - 将代码从 Mercurial 移动到 Bitbucket

git - Bitbucket git LFS 给出奇怪的错误信息

Git - 文件夹未推送到 repo

git - 为所有用户关闭分支上的 git fastforward

git - 从 bitbucket 部署到实时服务器

jenkins - Bitbucket和Jenkins远程构建触发器