Building Git on Leopard

So you want to use Git for distributed version control. For Mac OS X 10.5 there are a couple of options for installing Git.

  • Fink packages an almost up-to-date version, named simply git
  • MacPorts packages an up-to-date version asgit-core

Either of these methods, though, installs lots of dependencies. Which requires lots of compile time. And lots of disk space — especially for the MacPorts version.

So I prefer to compile Git myself — and use Fink for dependencies. Here’s how I do it.

Install Fink by following Fink’s installation instructions.

fink install gettext-tools expat1-shlibs

From here the instructions in Git’s INSTALL file work just fine:

curl -O http://kernel.org/pub/software/scm/git/git-1.5.4.5.tar.gz
tar zxf git-1.5.4.5.tar.gz
cd git-1.5.4.5
make prefix=/usr/local all 
sudo make prefix=/usr/local install

Now for the manpages.

Rather than build the docs ourselves (which requires asciidoc and a host of dependencies), I prefer to download them precompiled from Git and manually copy them into /usr/local/share/man.

curl -O http://kernel.org/pub/software/scm/git/git-manpages-1.5.4.5.tar.gz
sudo tar zxf git-manpages-1.5.4.5.tar.gz  -C /usr/local/share/man

(Replace the version numbers here with what’s right for the version of Git you’re installing.)

Now we’re ready to try this out, we’ll ask what version we just installed, then show the manpage:

git --version
man git

Done. Happy versioning!

Update

Sean Santry has an even simpler way to avoid the gettext-tools dependency — by telling make that we don’t have msgfmt at all.

NO_MSGFMT=yes make prefix=/usr/local all
sudo make prefix=/usr/local install

Using this tip you can build Git without Fink altogether!

Comments on the Original Post

You can also just install a complete OS X package from http://code.google.com/p/git-osx-installer/. It’s only 3.6MB and spares you the manual install

That’s great, Pieter — thanks for the link to a pre-compiled installer for OS X.
And these instructions for building your own package look good, too.

Posted
 

Time Machine Backups over WiFi

Leopard does not (yet?) backup to a disk attached to an Airport base station, to lots of people’s concern. But OS X version 10.5.1 will backup over the network — to another Mac. It works just fine over wired or wifi networks, so it works for MacBooks.

Initial setup is easy.

On the host Mac: Plug in your external drive. Turn on File Sharing from System Preferences (AFP, the default, is what you want). Share a directory on your external drive where you’ll store the backups.

On the Mac you want to back up: Mount the backup share. Then go to Time Machine in System Preferences, and turn it on. When it asks you for a backup destination, select your backup share.

Each time you backup…

Time Machine then needs two things before it will backup your MacBook:

  1. Plug the laptop into a power supply. Time Machine won’t start a backup if you’re running on battery power.
  2. Mount the share that holds your backups. (Double-click on it in Finder.)
  3. Done. Time Machine will back up on schedule, so you can keep working. But if you’re anxious, you can also start the backup by picking “Back Up Now” from the Time Machine icon.

I find these two steps to be much more convenient than plugging the external drive into the laptop, and I hope you will, too.

Update 31 May 2008: Since Leopard 10.5.3, Time Machine no longer requires any of this — it mounts backup shares when needed, so you don’t have to do anything. Once you get Time Machine working again, that is. If you’re having troubles since the 10.5.3 update, readA Fix for Time Machine on OSX 10.5.3 over AFP for .mac Users, a how-to that will get you going again.

Posted
 

Online Backups

We’ve been testing online backup software here at el-Studio for a while now. Remarkable how the slipping of the little rubber band inside our tape drive — the one that connects the motor with the thingy that spins the tape — brings online backups to mind.

Plus there’s the appeal of saying “We backup to the cloud, man.”

Anyway, our favorite online backup software/service is Mozy.

First, we could tell by the way the folks at Mozy write that they feel our pain:

Alternatives to Mozy

  • Burn a new CD or DVD every Sunday night and store them at your brother-in-law’s office.
  • Pay $200/year for an online backup service that uses old, mediocre software.
  • Buy a $200 external hard drive and hope your office doesn’t burn down.
  • Do nothing and don’t worry about backup. (We suggest closing your eyes, plugging your ears and repeating “I’m in my happy place, I’m in my happy place.”)
  • Run a cron job of rsync, gzip and mcrypt piped over ssh to your friend’s server over his DSL line.

 

That last option, by the way, isn’t so bad. For one server. Until your friend’s IP address changes.

But Mozy, it turns out, backs up really well — the best set-and-forget backup software we’ve seen.

We use the Mac version of their software, which is still in beta. Here’s how it works —

  1. Download the software and install it
  2. Pick the files you want to back up
  3. Let it run. In the background. Automatically.

That’s it. First run will take quite a while (like days) — but you can work normally in the meantime. And after that, the software runs whenever your machine sits idle for a bit.

Restores are a matter of going to the Mozy website and using an online file picker. You can download the results — or, if you want, Mozy can FedEx you a DVD.

Cost? Free for 2G, or $5/month for unlimited storage.

Or if you use this link to Mozy, you’ll tell ‘em we sent you — and they’ll throw in an extra quarter gig for free.

Aside in the voice of a media outlet: We have no financial stake in Mozy, and don’t know anybody there. And, as paying customers, that Mozy code gets us nothing. We just like their software. If you’re in the market for online backup, you might, too.

Cautions

Mac Mozy is beta software, and there have been some issues with earlier versions.

That said, versions since 0.5.1 have worked for us (latest as of this writing is 0.6.0). And the software does update itself.

Besides the beta software issue, there are a couple of things worth thinking about before relying on Mozy:

  • Online means that somebody else could get to your data. While Mozy encrypts your backups — using a key you provide, if you wish — its web-based restore can mean these are only as secure as your password.
  • Backups are saved at a single data center in Salt Lake City. Redundancy here would be nice.

But for us, the software’s ease-of-use — and the tape drive’s slipping rubber band — trump these concerns.

We backup to the cloud, man.

Posted