Megan Lin
Megan Lin

Reputation: 81

Bitbucket Hooks vs Webhooks

What's the difference between hooks and webhooks in BitBucket? I've read the documentation for both but I can't seem to understand when you would use one over the other.

Edit: Documentation that I read.

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

Upvotes: 8

Views: 7125

Answers (2)

Jim Redmond
Jim Redmond

Reputation: 5660

As ben5556 mentioned, you're comparing Bitbucket Cloud documentation to Bitbucket Server documentation. There's another important distinction here, though: the Bitbucket Server docs you linked refer to git hooks, which are a native part of Git, and the Bitbucket Cloud docs refer to webhooks, which are an HTTP-based callback mechanism. (In the interest of full disclosure, Bitbucket Server can send webhooks as well: https://confluence.atlassian.com/bitbucketserver/managing-webhooks-in-bitbucket-server-938025878.html)

You can't currently control git hooks on Bitbucket Cloud, but on Bitbucket Server (where you'd only break your own stuff) you can use those to control different parts of the git workflow. For example, on BB Server, you can use a pre-receive hook to reject pushes if some commits don't have a ticket number in the commit message, or you can use a post-receive hook to notify your (human) users about upcoming maintenance.

Webhooks are typically used more as a notification method - you can have Bitbucket notify Slack about pull request merges, for example, or have Bitbucket notify your CI/CD system that there are new commits to test.

Upvotes: 4

ben5556
ben5556

Reputation: 3018

Both are same from what I understand. One refers to Bitbucket server while the other refers to Bitbucket cloud but in essence their purpose is same.

Upvotes: 0

Related Questions