There are several ways you can configure pre-receive and post-receive hooks. You can write them in Java as plugins, which is convenient if you're more comfortable with Java or want to implement deeper integration with the product (e.g. interact with pull requests, trigger a background job, etc).
You can also use existing scripts directly. This knowledge base article has details that describe how to set them up (under the "Create Hook" section).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.