After some in-depth community discussion earlier this year, the decision was made that Drupal development will move from the CVS version control system (VCS, confusingly) to Git — the VCS developed to manage development of the entire Linux operating system.
The change was not unexpected, as developers have long complained about the limitations and quirks of CVS, but it was not rushed into either — as the move will be a huge task.
To make the transition as smooth as possible it has been organised in three clear phases:
- Create a read-only Git Mirror
- Using Git but retaining a centralized workflow
- Moving to a fully decentralized workflow
Phase 1 is mostly complete http://git.drupal.org now operates as a read only mirror of the CVS repositories and you can clone from it if you wish.
There are some big ideas about what could happen in Phase 3 and beyond, but for now I’m going to focus on the immediate future of Phases 1 & 2 and what it means for developers.
First, it’s well worth watching this video from Drupalcon 2010 in San Francisco in which the project leads of the move to Git presented a session on their plans:
A Git Primer
So, you can already start playing around with Drupal and Git. If you’re not used to working with Git, here are some useful resources to get started with:
- Git Magic is a fantastic tutorial and reference. A great starting place
- The Git Community Book also offers a lot of help.
- Git Tutorial to walks you through the most common commands needed in a typical workflow
- Git Documentation is the Git project’s official manual
- And here’s a Git Cheatsheet to print out and keep on your desk
CVS and Git
It’s going to take a while for the official Drupal repositories to move fully to Git, so if you want to move your own workflow over in the meantime, you’ll need to somehow keep your project in Git in sync with the drupal.org CVS repository for your project. Thankfully there’s an app for that!
Wolfgang Ziegler (Fago) has written a blog post about using Git to maintain a Drupal module and keep in sync with CVS — and he’s also written the code to help.
The code is available at Github: http://github.com/fago/drupal-git-sync
SVN and Git
A couple of years ago there was a bit of a false start on a campaign to move Drupal development to the Subversion VCS. Live CVS, this is based around the concept of a central repository that developers checkout, alter, and commit back to — so it’s not a huge difference. But it did offer some performance and workflow benefits.
As a result a number of Drupal agencies moved to using Subversion for their own code — and now have to face changing again, and retraining.
Jerad Bitner, from Lullabot, has this blog post about the move from Subversion to Git. He focuses on a way of using Git and Subversion together:
Most development shops use Subversion for their VCS needs. It’s not really going anywhere soon, and the transition to a Git world will probably be a little slow, especially if you are collaborating with other shops or people who do not know Git, are unwilling to learn Git, or you just don’t have the time/resources to teach or convince them of Git. So if all of your repos belong to SVN, how can you get into the practice of using Git in your daily work life?
In steps git-svn. This great tool allows you to work with a remote Subversion repository while using Git on your local machine! You can run all of your normal Git commands locally, merging, branching and even merging Subversion branches (which Git is far superior at doing) all without using Subversion commands and still keeping your remote Subversion repository intact. Other developers can still use it exactly how they are used to, and run Subversion commands if they want… but you will have the real power!
Jerad runs through a typical workflow on this kind of setup, and the article is a must read for anyone who currently uses Subversion.
Moving to Git is a huge project, but it should bring great benefits in terms of speed and flexibility of development - and making it easier for the wider community to contribute to any project.
Along the road there’ll be a lot to learn and a lot of experiences to share — and we at Drupal Radar will keep watching and reporting for you.