r/git • u/florianbeer • Apr 25 '16
Dropbox as a True Git Server
http://www.anishathalye.com/2016/04/25/dropbox-as-a-true-git-server/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/berkes Apr 26 '16
That whole setup must have been an immense nightmare even before it started to fall apart.
Well, they came from CVS. So compared to that, their setup was not that big of a nightmare. For them, git was nothing more than a way to add some log to the work done and to backup the work. Somewhat.
1
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...
1
u/LB-- git merge --no-ff --no-commit Apr 25 '16
What about Google Drive and OneDrive? And possibly others? Does this use some special API unique to Dropbox?
3
u/flyingmeteor Apr 26 '16
Yes it uses Dropbox's API. It doesn't require the Dropbox client to be installed because it's interacting directly with the server via their API.
0
u/sydalmighty Apr 26 '16
Wow, this looks pretty cool and neat too! Still, I would stick with bitbucket the issue tracking is cool. Atlassian for the win! 😂
1
Apr 26 '16
[removed] — view removed comment
2
u/florianbeer Apr 26 '16
What do you mean by "running out of private repos"? Do you mean repos on GitHub?
Are you aware that you can freely host as many private (and privately shared) repos as you want on https://gitlab.com ?
1
2
u/florianbeer Apr 25 '16
I'd rather stick with my gitlab.com account for private repos (for the collaboration stuff) but this seems to work quite well too for simple remotes.