Dropbox, Live Mesh, Git

Back in December I blogged about Live Mesh. I was initially confused by the Vista installation experience, but Live Mesh worked OK on Leopard. After receiving some helpful comments from some Microsoft employees, I decided to give Live Mesh another shot.

Ever since then, I’ve used Live Mesh on two computers: my MacBook Pro at home and my Vista machine at work. My needs are pretty simple. I have a folder on each computer where I keep some e-books, plain text files with TODO lists and comic ideas, and various other important documents. Up until today, Live Mesh has kept these directories perfectly in sync. Just drop a file in, and a few moments later it shows up on the other computer.

Last night, however, I pushed it too far. I created a Git repository in my Live Mesh folder here on my Mac. When I arrived at work this morning, Live Mesh complained about a huge number of so-called “conflicts”. The conflict resolution was utterly confusing and I screwed it up completely. Every time I finished, it reported new conflicts. This was a disaster, everything was hosed.

So this evening, I disabled Live Mesh, went into Time Machine, and restored the files. This is the first time I’ve used Time Machine for a real recovery, and it worked flawlessly. Everything is back to normal.

Live Mesh Fail

Why would Live Mesh report conflicts? I can understand if these computers were sitting side-by-side and I was rapidly adding, removing, and renaming files. But this was not the case. Both computers were in sync, and I was updating on one computer only. This should have been a unidirectional sync without any conflicts. I guess this is what they mean by “beta”.

Live Mesh exists for one purpose: to share data between computers. Corrupting data is unthinkable. When conflicts do arise, the resolution procedure needs to be easy, and it is not.

Dropbox

So this evening I installed Dropbox, and I will use this instead of Live Mesh. The installation was effortless, even easier than the Live Mesh Leopard installer. Copying my documents and e-books went as expected, all simple drag-and-drop operations.

Next up, Git.

Git on Dropbox

Rather than creating a repository and working copy in the Dropbox directory, this time I wanted to create a Git bare repository in Dropbox. Based on this excellent article, I was able to accomplish this in a matter of minutes. Here are the steps:

  1. I already had a Git repository in ~/Documents/livemesh/myproject. Before doing anything, I ensured everything was committed.
  2. cd ~/Dropbox
  3. git clone --bare ~/Documents/livemesh/myproject myproject
    (this created a bare repository in ~/Dropbox/myproject)
  4. cd ~/dev
  5. git clone ~/Dropbox/myproject myproject
    (this made my Git working copy in ~/dev/myproject)

Now I can do my day-to-day work in ~/dev/myproject. After committing any new edits, I can type git push to send my changes to Dropbox. On the other computer, I can receive changes by typing git pull.

So far Git has been far easier than I imagined, therefore I am kicking myself for not learning it sooner. Since I’m rambling, I’ll point you to git-osx-installer, which makes Git installation trivial on OSX.


Is there any particular reason that you chose not to house your repository _and_ working directory in Dropbox? I’ve been doing this for a while with several projects and it’s worked out okay. I have my working directory in ~/Dropbox/dev/myproject and a symlink to that directory in ~/Development/myproject.

Just curious whether it was something more than personal preference that led you to keep your working directory outside of Dropbox.

gnowoel Says:

Rob, there are three reasons that lead me to keep my working directory outside of Dropbox:

1. Backing up checked-out working branch is a waste of space.
2. Sometimes, I do temporary work and I don’t want to make dropbox keep busy.
3. Working directories are just for work, I’ll delete them eventually someday.
4. Having 2 copies is insurance, and I believe it’s what means by ‘backup’.