Installing Git With Redmine

Until recently, my favorite version control and project management environment consisted of Subversion supported by Trac. It has own limitations (especially Trac’s lack of support for multiple projects) but I got used to it.

Anyway, my team mates were advocating use of Git as VCS, which better fits our dislocated (distributed) team organization. After little research, we’ve found something that looked like a perfect replacement for Trac: Redmine supports multiple projects, has all features that we need and looks stable enough.

Thanks to BitNami’s stack for Redmine, we were able to install and try Redmine in our test environment without much effort. Everything worked nicely so I took the task to setup real development environment with:

  • Multiple Git repositories on server as the main (reference) code base, and

  • Redmine for issue tracking, planning, documentation, Git repository browsing, etc.

Setup of Git repositories and access rights was simple following excellent article Hosting Git repositories, The Easy (and Secure) Way.

Installation of Redmine was somewhat more complicated (as I’ve never installed Rails application before) but post Zero to Redmine in 22 steps was very useful.

I had both Git and Redmine working fine independently and needed to configure Git repository in Redmine. As mentioned in the documentation, I created bare clone of the main repos for Redmine so I ended with two clones of the git repository (for the same project):

  /var/git/repositories/internal/test.git  - Main repos (served by gitosis)
  /var/git/checkout/internal/test          - Redmine repos clone

In Redmine I setup Git repository for my test project to use /var/git/checkout/internal/test directory and it worked fine showing file tree and change sets. It’s worth to mention that both repositories were owned by git user. I added www-data user to the git group in order to allow Redmine to read repository.

Because Redmine uses clone of the main repository, there was a problem remaining to update Redmine repos when developers push change to the main repos. I’ve found many posts saying that hook on main repos should pull or fetch from Redmine repos. Unfortunatelly, this didn’t work well with bare repos clone (pull is not valid for this format, while fetch didn’t work as expected). Finally, I’ve found a post saying that main repos should push changes to Redmine clone repos. (Detailed example can be found at http://www.redmine.org/issues/2173.) This was a surprise for me but it worked.

Comments