In this page

Overview

This page is about implementing Better Commit Policy specifically in Git repositories hosted by the GitHub service. If you use Git, but not GitHub, please see the general Git guide instead.

Working with GitHub commit policies

GitHub hooks: the limitation

GitHub is a public cloud-based service operated by its own team. Being a managed service, it doesn't give access the filesystem where the central repositories are stored, therefore you cannot manually install Git hooks to those. GitHub has no web-based feature to manage Git hooks, either.

It means that GitHub does not allow using custom server-side hooks currently.

As Better Commit Policy relies on server-side hooks for server-side verification, you can implement Better Commit Policy only in the local repositories for GitHub at the moment.

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

GitHub hooks: the solution

To work around the limitation caused by missing server-side hooks, use local hooks consistently.

Note that it is possible to reach the same level of safety by using local hooks only as by using server-side hooks. For that, all developers in your team should activate local verification in their local repositories. It guarantees that only verified commits will be pushed to the central repository hosted by GitHub.

The ultimate solution

Although the current solution works fine, we will absolutely implement server-side verification also for GitHub as soon as they support custom server-side hooks. Note that only the GitHub team can remove this blocker.

To indicate its importance:

  1. Please open a ticket in the GitHub support system. Ask for the feature "Support for custom pre-receive hooks" and explain your use case in short. As it takes only 2 minutes of your time, absolutely do this. The more tickets opened with this feature request, the higher probability it will be implemented.
  2. Also, there is a counter-part feature request at Midori. Although the GitHub feature request must be solved first, we use this one to collect feedback and interest on our side. Vote for this by clicking the "thumbs-up" icon, add your use case as a comment and click "Follow". All future updates on this story will be posted there.

Installing GitHub hooks

Installing GitHub hooks for local verification

The process is straight-forward:

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

That's it.

GitHub commits

In your daily developer workflow, when creating commits and pushing those to GitHub, you can use your Git client in the usual way. Looking from the client side, GitHub will be totally transparent for you: it will be "just a Git server".

See the Git commits section for detailed instructions.

Questions?

Ask us any time.