All the cool kids are using distributed version control systems these days. And the coolest of these systems is git. I have been a long time version control geek (my first co-op engineering work report at the University of Waterloo was about Nortel's version control system!)!
So, I have wanted to learn git but had no project. A few weeks ago I realized that Acquia Drupal wasn't released using version control which was surprising; it therefore seemed like a perfect fit: check Acquia Drupal 1.2.1 into the wonderful hosted service for git, github, to help others and myself when it came time for the upgrade to 1.2.2 or whatever the next Acquia version is called. Of course you could also do this in CVS or SVN but that wouldn't be as much fun and there wouldn't be the easy branching features of a distributed version control system!
If you are a git lover or veteran you can find the result of my experiment at: http://github.com/rtanglao/acquia-drupal-6
After the jump, the gory technical details to help others new to git and of course to get feedback and improve my usage of git in the future!
WARNING: These instructions are about an exploratory project. Raincity Studios does NOT support git or these instructions. DO NOT FOLLOW THEM on a production site UNLESS you have a BACKUP of all your files and database first, have tested them on a staging site AND have the technical knowledge to revert back to your backup should anything go wrong.
Here's (You can find further more detailed notes about me learning git at: http://sites.google.com/site/githubacquia) what I did:
How I checked the release in:
download acquia drupal 1.2.1 and unzip it
cd acquia-drupal-6 (or whatever the directory you just unzipped in the previous step was called)
mv * ..
mv .htaccess ..
cd ..
rmdir acquia-drupal-1.2.1
mkdir acquia-drupal-6
cd acquia-drupal-6
git init
cp drupal acquia 1.2.1 folder to acquia-drupal-6
git add .
git commit -m 'first commit of drupal acquia 1.2.1'
git commit -m "first commit of acquia drupal 6 version 1.2.1"
git remote add github git@github.com:rtanglao/acquia-drupal-6.git
git push github master
How to check it out onto your server and use it
install git on your server if it hasn't been already installed (left as an exercise to the reader :-) !)
cd /var/www (or wherever you put your drupal releases)
git clone git://github.com/rtanglao/acquia-drupal-6.git
create your Drupal D6 site as usual
How updating will work:
I think this is how it will work! I will write a follow-up post when the Acquia post 1.2.1 release comes out.
Update the release (untested, will post a followup post when the post 1.2.1 release comes up):
- checkout from git://github.com/rtanglao/acquia-drupal-6.git
- download the post 1.2.1. release and unzip and remove the post 1.2.1 subdirectory by moving everything up) over the directory (e.g. let's henceforth pretend post 1.2.1 release is called 1.2.2, "cd acquia-drupal-1.2.2; mv * ..; mv .htaccess ..; cd .., rmdir acquia-drupal-1.2.2")
git commit -m "committing 1.2.2"
git tag -a "acquia-drupal-1.2.2"
Test and deploy the new release:
git checkout acquia-drupal-1.2.2 on staging server
- deploy to production (deployment is an entire blog post I will leave as another exercise to the reader!)