37
votes

I am considering moving from svn and Trac to git and Redmine. I'm just wondering what everyone's experience is of this. How well does git integrate with Redmine?

I'm pretty set on my decision to change from svn to git - our distributed work, and need to frequently branch and merge would make life considerably easier with git. But we would possibly need to split things into multiple projects for this. From what I have been reading, git and multiple projects don't integrate too smoothly with Trac. That aside, in my investigations into git, Redmine has also caught my attention, and some of the features look very useful.

However, I haven't found as many user experiences of git and Redmine as what I'd like (possibly due to my lack of searching skills...) and so would like to hear your opinions and examples.

6

6 Answers

30
votes

I built a system last year which used Gitorious and Redmine. You can integrate git directly with Redmine, no problems there but I would strongly suggest you have a look at Gitorious as well as the tool to control your repositories and follow their events. It can also be used to control access to the repositories etc.

Integrating Gitorious and Redmine is pretty simple. I wrote a script that unhashes the Gitorious paths. They are saved in the file system hashed when you use Gitorious so linking those repositories to Redmine would be a bit complex otherwise. My script makes links to those repositories in a much more readable format so linking them to Redmine is really simple, and only required once when you create the project. You can find the script here.

Basically you don't need to worry about the integration a lot since Redmine supports git out-of-box - sort of. Of course you need to have the git service running on the server where you "production" repositories are (those that you link to Redmine, do your automated tests etc), but this is also solved with Gitorious.

I actually wrote my Bachelor's thesis about this issue. It's already slightly outdated since both Gitorious and Redmine have developed a lot, but I could make it available if you want to read it. The thesis explains what needs to be done (some of the problems have already been solved by the two tools) and it also includes a continuous integration environment which automatically builds packages when users push changes to the repositories and puts them into a reprepro repository where testers etc. can easily download them with a web browser.

Redmine had some issues last year, especially the lack of sub-projects was a bit annoying but that has been rectified in the 0.9 version. Also the plug-ins should be tested well before taken into production use, some just don't mix well and some don't work at all (probably a clash of Redmine version vs. plug-in version). All in all, though, Redmine works pretty well and should be easily expandable to your needs. Support for Gitorious is superb, for Redmine a bit more sporadic (damn French?) but both tools have large enough user bases that they should be safe bets.

Git is a very good version control tool especially for agile teams. It takes some learning and you should write a guide on how to use it for your developers to get the most out of it, but once you learn it, it's extremely productive. We wrote our own which just states the normal working process. Branching, merging etc. should be explained, for instance working on your personal repository's master branch is not such a good idea. Always create a branch and work there. When you pull changes to your master branch from some other repository, it's easier to handle the merging this way - and you won't accidentally push something you didn't mean to.

12
votes

it is a great match due to flexibility in those nice two platform

Integration Setup

  • setup official git repository (master) in another place using gitolite or gerrit for easy administration, since redmine doesn't provide those functionality for git
  • run simple cron job to sync master git repo to redmine git repo as readonly mode

Integration usage of both

  • automatically see the relation with issues with git commit
  • automatically control the issue with git commit

please take a look at my blogs ALM – From requirement to implementation and deployment and ALM – redmine integration with git, well done

Anyway I am happy with the integration.

limited support for multi git repositories

One thing I noticed is it can't support multi git repositories, see feature http://www.redmine.org/issues/779

Also when you setup the git repository for first time, it can't be changed, be aware of this

7
votes

Hello I wrote a guide for this some time ago. The guide installs a clean git and a clean redmine. No other extra software needed. It even lets you handle accounts within redmine though http git.

You can find it here: http://codersopinion.com/blog/install-redmine-with-automated-git-on-centos-redhat/

Because I wrote this guide a while ago the versions might not match but it should still work with current versions.

1
votes

I stumbled upon this thread when searching on how to integrate Redmine with Gitorious properly. Since we managed to achieve this and now have some long (or medium) term expierience with it, I thought I'd share it.

We took a different approach than cronjobs, since it was a bit too inflexible for us. We also refer to other tutorials for the installation part of Redmine and Gitorious in our blog post:

http://codepool.at/blog/archives/12

We are using this system for about 5 months now and are pretty happy with it. The only "issue" is that everytime you create a new project in Redmine, you have to run some terminal command so you can connect the project to the repository. Since we are not creating projects en masse, it is just the right approach for us.

I hope this helps!

1
votes

Another thing you may want to consider is access control. If you want to be able to control commit access to different projects through redmine then this will be helpful.

http://wiki.bitnami.org/Applications/BitNami_Redmine_Stack#How_to_configure_Redmine_for_advanced_integration_with_Git

Not sure how you would link redmine accounts with Gitorious but that may be possible as well.

1
votes

I'm satisfied with my git+redmine setup (and use gitolite for repos administration), here are some python hooks I use to leverage the use of both tools :

Preambule : setting up a rest.bot user

Hooks operations will be performed being authentified as a rest.bot user.
Go to Redmine administration console and create this rest.bot user.
On Roles and permissions page, create a Rest bot group with View issues and Edit issues as only permissions.
Don't forget to configure authorized statuses transitions for this role on the Workflow page.
Add rest.bot user to your projects with role Rest bot assigned.

Client commit-msg hook: expand issue number to issue title

https://gist.github.com/KraYmer/4443858 to edit and copy in <git dir>/share/git-core/templates/hooks on the client machine

This hook allows you to reference a Redmine issue in your git commit message by simply typing its issue number and having it automatically expanded by appending the issue subject.

'working on ref #1234' => 'working on ref #1234:Eliminate dangling pointers'

Server post-receive hook: change status of issues by parsing git commit messages

https://gist.github.com/KraYmer/5292077 to edit and copy in the .gitolite/common/hooks directory on the server

Referencing issues in commit messages is a feature shipped with the default Redmine but is limited to simply referencing (no status changed) or closing the issue.
This hook aims to extend the set of recognized keywords to change the status of the issues on commits :

$ git push
...
remote: [post-receive] Parsing 1 commits for branch 'develop'
remote: [post-receive] Setting issue #1608 status to 'totest'
...

The hook takes care of fetching the changes as soon as a commit is done so the changes are reflected in real time on the website.