In this page


This page is about implementing the Commit Policy Plugin with the Git version control system and GitHub. If you use Git alone (i.e. without GitHub), please see the Git page instead.

GitHub is a leading cloud-based hosting service for Git repositories. It should not be mixed with GitHub Enterprise, another GitHub Inc. product, which is a self-hosted solution for Git management.

Working with GitHub commit policies

The primary problem with GitHub is, that it does not allow users to customize the server-side hooks in their repositories. This is a deliberate design decision by GitHub, because freely modifying hooks could easily lead to bugs and security issues.

As the Commit Policy Plugin integrates with Git using hooks, this is not possible to implement the Commit Policy Plugin directly in the GitHub managed server-side repositories. Wait, just read on, because there is a viable solution though!

What you can absolutely do is executing the verification in the developers' own clone repositories! When all your developers install the hooks to their local clone repositories, then this scenario is essentially equivalent with installing the hooks to the blessed repository itself. This way you get the best of both worlds: hosting your repositories in the cloud, and verifying the commits pushed into that at commit time (in local clones).

Installing GitHub commit policies

The process looks like this:

  1. Create the commit policy.
  2. Send an email to all your developers and ask them to install the hook script for this policy to their local repositories.

Please note that a "share policy" feature that eases distributing and monitoring the hook script installation will be implemented soon. If this is valuable to you, please 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 the Commit Policy Plugin 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! Contact him and 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.

No other limitations

Other than the inability to install directly to the blessed repository, all features of the Commit Policy Plugin for Jira work without limitations, also for GitHub managed repositories.


Ask us any time.