r/git • • Apr 25 '16

Dropbox as a True Git Server

http://www.anishathalye.com/2016/04/25/dropbox-as-a-true-git-server/
17 Upvotes

12 comments sorted by

View all comments

2

u/berkes Apr 26 '16

Nice solution!

On a related note: I've once consulted for a team who lost weeks of work (and about to miss a deadline) because of their "git in Dropbox setup".

Their setup: dropbox, with a shared directory "project_foo". Everyone used "path/to/project_foo" as their working copy. They tried to replicate their previous, simple, centralised CVS workflow this way.

I helped them recover from conflicts in the .git directory. Dropbox "resolved" these and threw away crucial files. Resulting in a broken "git database".

Result: we recovered some work, some was lost for good. They missed the deadline and I learned a lot about the (very elegant) tree database of git.

In short: don't try this at home. Git in a Dropbox synced directory is a very bad idea.

1

u/florianbeer Apr 26 '16

Well, using the directory in Dropbox as a working copy is a bad idea. I found this out myself when it began to sync thousands of small files all the time when I switched between my desktop and my laptop. But this technique uses Dropbox as a remote and not as a working copy.

The company you where consulting for used a shared working copy? Why would they then still use git on top of that, if they thought that was a good idea? That whole setup must have been an immense nightmare even before it started to fall apart.

1

u/[deleted] Apr 26 '16

A shared NFS/SMB mount works fine because of lock files.

The problem is Dropbox updates files in the background so in theory two people could create the same lock file, etc...