In this page

This page is specifically for Git repositories hosted by the service!

If you use Git, but not, please see the general Git guide instead.
Or, if you use GitLab Community Edition (CE) or GitLab Enterprise Edition (EE), not, see the Git with GitLab CE/EE guide instead.

Working with commit policies

The problem with hooks is a public cloud-based service operated by its own team. Unfortunately, the service does not allow customizing the server-side hooks in the repositories! It is by design.

They decided to disallow it, because customizing uncontrolled hooks could lead to stability problems and security issues, which would then destroy the experience. Again, it is a deliberate decision by the team, not a defect in and not a defect in Better Commit Policy.

Consequently, as Better Commit Policy relies on Git hooks, it is not possible to implement Better Commit Policy directly in the server-side repositories.

Read on, there is another approach you can take!

Using local hooks instead of hooks

What you can do is executing the verification in the developers' local repositories instead of the central repository. It works perfectly also with If all developers install the hooks to their local clone repositories, you get the same level of safety as if you'd enforce the policy in the central repository.

There are no other limitations. All features of the Better Commit Policy app work also for hosted repositories.

Installing commit policies

The process looks like this:

  1. Create the commit policy.
  2. Ask your developers to install hook script of the policy to their local repositories. (It's a short self-service process everyone can complete in minutes.)

(Please note that a "share policy" feature that eases distributing and monitoring the hook script installation will be implemented soon. If it were valuable to you, vote to the public feature request.)

Has every team member installed the hook script?

First the bad news: this is not possible to strictly enforce the installation of the hook scripts. Why? If the hook script is not installed, then your Git is basically not talking to Jira, so Better Commit Policy cannot know about your repository at all.

Nevertheless, administrators still have the possibility to keep their eyes on the commits, to spot the ones that are eventually violating the policy. For example, if you know that the policy requires mentioning a Jira issue, and a committer is sending commits without that, then clearly: he forgot to install the hook script! Ask him to do so!

(We have an idea for a creative solution for this problem, using a post-mortem mechanism to automagically detect these missing installations. If this is valuable to you, please vote to the public feature request.)


Ask us any time.