I've been plagued by the fact that at work I do my development on a remote system. This generally isn't a problem except on the rare occasion I want to use a debugger, since I'm a Vim user. However, when that time comes (and it always does), I have to sit there and wait while eclipse "builds" my project. Nothing irritates me more than "Hurry up and wait". Since I started working with Drupal, I've found this to be a very common theme. It's far from the speed that I got out of Zend Framework, or other MVC based frameworks, but it does so much for you. That's where it's easy to get "Drupal blindness". A tool I found that helps mitigate this is Unison. Now, I've done the whole rsync thing and copy my files back and forth.. or used a git repo to check things out locally, and even using a mapped driver via sshfs or dokan, but they are all slow when it comes to eclipse doing it's "scans". Unison takes a lot of the pain out of it... even on windows! So here's what you do for a windows machine!
Install GitSo head on over to git-scm and download git, double click the installer, follow the instructions. Simple as that... You may ask, "Why Git?"
- It's a good idea
- You are going to need the pre-compiled ssh client that comes with it later.
Install GTK+ 32-bitThis is pretty simple too. All you have to do is run over to GTK's site, and download the GTK+ run time package for 32-bit windows. The Unison executable is 32-bit. That's the reason I specify 32-bit. After you download it, unzip it to C:\Program Files (x86)\Gtk2. This will put it right along next to Git for easy access.
Add Git and GTK to Your PATH VariableThis is one of the least known facts about Windows. You do have a PATH variable just like any Linux distribution (OS X included). To do this, bring up your computer properties. You can do this by one of the following:
- Windows Key + Pause
- Right click on My Computer and goto properties
C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Gtk2\bininto the Variable value box. Make sure if you type it before anything else in the field, you add a semicolon after it, or if you type it after what's already in the field, you add a semicolon before it. Click a bunch of OK buttons to close all the dialogs out.
Download UnisonI found it difficult to find the exact download link just looking around the Unison pages, so here is the direct link to Unison 2.40. Unzip the zip you get and place Unison somewhere you won't lose it. My desktop worked fine in this case.
Set Unison Up On Remote MachineUnison is availaible for all sorts of operating systems. In my case, I have a Ubuntu box I'm working with so all I did was a simple:
sudo apt-get install unisonon the system that I wanted to sync with. This will involve you remotely accessing your other machine... In my case that means ssh. Man I wish it had been that easy to do it in Windows!
Set Up a Profile on Local UnisonWhen you double click on the Unison Icon, you will get something that looks simular to this: I've already set up my profiles though... Click on "Edit" to edit your default profile. Then click "Add" on the next dialog to add the folders we want to sync Go down and pick out "root" and click "Add" Click the new "Add" button on the next dialog titled "Edit the Preference" Type the folder you wish sync into the "Edited Item" field Click the "Edit" button. Repeat the steps for your remote file system. For me it was something along the lines of:
ssh://firstname.lastname@example.org//var/www/drupal-7.14There is very exhaustive documentation on roots over in Unison's user manual. Click OK until you get back to the "Profile Selection" dialog