Notes about Redmine and GitHub Post-commit Hooks

We’re currently using Redmine for our project tracking and recently have wanted to have our GitHub projects automatically get updated within Redmine. A post-commit hook to the rescue!

  1. Download and install this super plugin: https://github.com/koppen/redmine_github_hook and restart your Redmine instance.

  2. Set up your local Git instance for your repository.  This is simple, but you need to follow these steps or else pulling your changes down won’t work:

    git clone --bare git://github.com/davidjb/123.git
    cd 123.git
    git remote add origin git://github.com/davidjb/123.git
    
  3. Configure your Redmine project’s Repository to be this Git directory. (This is a given, but just so you know.)

  4. Configure your GitHub repository to have a ‘Post-Receive URL’ service hook and point that at your Redmine URL like so:

    https://davidjb.com/redmine/github_hook?project_id=myproject
    

    where myproject is your Redmine project ID. You can ignore the ?project_id=myproject if your GitHub repository name is the same as your Redmine project ID.

Beware the pre-existing Redmine service hook in the current iteration of GitHub (circa 2011) - it effectively doesn’t do anything. This may change in the future, but until then, this works fantastically.

Comments !

blogroll

social