Redmine GitLab Hook

This plugin allows you to update your local Git repositories in Redmine when changes have been pushed to GitLab.


Redmine has supported Git repositories for a long time, allowing you to browse your code and view your changesets directly in Redmine. For this purpose, Redmine relies on local clones of the Git repositories.

If your shared repository is on a remote machine - for example on GitLab - this unfortunately means a bit of legwork to keep the local, Redmine-accessible repository up-to-date. The common approach is to set up a cronjob that pulls in any changes with regular intervals and updates Redmine with them.

That approach works perfectly fine, but is a bit heavy-handed and cumbersome. The Redmine GitLab Hook plugin allows GitLab to notify your Redmine installation when changes have been pushed to a repository, triggering an update of your local repository and Redmine data only when it is actually necessary.


  1. Installing the plugin

    1. Follow the plugin installation procedure at

    2. Restart your Redmine.

    3. If you already have a local Git repository set up and working from Redmine go to step 3, otherwise continue at step 2.

  2. Adding a Git repository to a project (note, this should work whether you want to use Redmine GitLab Hook or not). Simply follow the instructions at . If the repository was cloned with “clone –mirror” please turn on the option “all_branches” in the plugin config page!

  3. Restart Redmine

  4. In the project settings, activate “repository” module and add a new repository. Repository identifier is composed with project_namespace_repository_name. E.g. project name “test” in project namespace “business” with repository name “rails” results in “business_test_rails” as repository identifier. If no project namespace is used, use only the repository name. E.g. “rails”.

  5. GitLab

    1. Go to the repository interface on GitLab.

    2. Under “Web Hooks” add a new “Post-Receive URL” of the format:

      • redmine_installation_url/gitlab_hook?project_id=identifier&key=redmine_repository_API_key“

      • project_id = Redmine project identifier

      • key = Redmine repository API key


    That's it. GitLab will now send a HTTP POST to the Redmine GitLab Hook plugin whenever changes are pushed to GitLab. The plugin then takes care of pulling the changes to the local repository and updating the Redmine database with them.


To debug the API interface of redmine_gitlab_hook try out RESTClient ( a nice add-on for Chrome, Firefox and Safari. Please keep in mind, that the request method must be of type POST!


  • GitLab >= 5.x

  • Redmine 2.x running on a *nix-like system. Older versions of redmine will not work.

  • Git 1.7.10 or higher available on the commandline. Also supports Git 1.8 repositories which are mirrored with the new “clone –mirror” command (default: off, please turn on in options when new mirror command was used).