Mercurial (and, I guess Git) with Dropbox: any drawbacks?

Solution 1:

I'd advise against it for the reasons stated above, but more strenuously stated. Both mercurial and git have their own protocols for moving changesets between repositories. These protocols are optimized/built for:

  • efficiency
  • consistency (never can you pull from a repo in a half-updated state)
  • hooks/triggers -- doing things on push/pull including quality (no tabs allowed, etc.) filters

When you just let a directory sync handle the keeping of the .hg (or .git) directories in sync then during that sync you've got a remote store that's in an inconsistent state and doesn't know it.

Additionally both hg and git have a separation of what's local-only and what's remote-okay within their disk state. They know what info to share (example: commited changesets) and what not to (example: current, local working directory parent revision).

In other answers folks are saying "you'll probably be fine" or "I've never had a problem" and that's likely true, but it's not guaranteed true, and revision control isn't a place to play the odds. Use the proper, better, safer, more efficient, more full featured synchronization protocol for your source control system.

Solution 2:

I've had problems with my Dropbox'ed repositories becoming corrupted. It doesn't happen all the time, but the fact that it has happened more than once means that I'm going to stop using Dropbox for this purpose.

That said, Dropbox is certainly cheaper than getting real hosting, so as long as you keep backups you may find it acceptable for personal projects.

Solution 3:

I suppose that would probably work okay for personal projects on one or two machines, but really you're going to want to use professional hosting for multi member projects.

I have personally used BitBucket for some time and have been quite pleased... you can have one private project on the free account, too.

Solution 4:

I'd expect problems if you try to access repository in the middle of the sync. It also seems to be a bit of overhead. You don't really need to sync over the stuff you sync. I have no idea how dropbox handles conflicts, but I doubt it can do it in an scm-aware way.

Solution 5:

+1 for bitbucket. It's free, and you get a single private repo with that free account (unlike github).

The drawback with the dropbox only solution is that if you do screw something up in the repo on your machine, that screwup will be copied out to bitbucket and replicated to every other place you've got the dropbox installed. Dropbox is very quick, so you won't be able to stop it from happening in time to prevent issues.

You lose the ability to decouple making changes to your repository with publishing those changes.

I do use dropbox to host a couple of repositories that I use on both my home and work machines, but those aren't the only copies of those repositories. There's also a bitbucket repo (as well as other people that have clones of them).