Using Git with Dropbox
solarianprogrammer.com
solarianprogrammer.com
You don't have the possibility of corrupting your repo with an unsynced commit from a differennt machine.
I've used dropbox+git for sometime [1]. It throws "conflicted copy" error [2] when two people push to origin at the same time. Bitbucket much better than dropbox, but not as awesome as github.
[1] Shorter version - http://stackoverflow.com/a/1961515/45582
[2] http://shikii.net/blog/ignoring-funny-ref-error-on-git-dropb...
Git uses other files for tracking things, for example: .git/refs/* and .git/HEAD, which point to particular objects (via SHA-1 hashes). If one of these has a "confilicted change" (via dropbox), one person has the HEAD of the repo (or some other branch) pointing to a commit they do not expect it to point to. Even more interesting is when one person wins HEAD and the other wins it's paired branch in .git/refs/ .
Further, git does occasional packing of the object repository. 2 People attempting to pack the object repository when it contains different items might produce interesting results.
See the birthday problem: http://en.wikipedia.org/wiki/Birthday_problem
It was not the end of the world, but I would not recommend storing git repo in dropbox. If it's really something so small and insignificant that it doesn't need a git repo, then just put it in dropbox. If you want to use git, take the time to set up a proper repository.
Anyway, not something I would recommend.
Run "find .git -name 'conflict'" in your working directory to see if this has happened to you.
Life is short.
What this means is checking out a git repo like the Linux kernel will not work. This drove me a little nuts until I figured out what happened (I'm an old school Unix guy so did not realize that HFS+ is case insensitive).
- get burned by case insensitive filesystem
- swear that next time I'll reformat it to be case sensitive
[much time passes]
- get new machine
[much more time passes]
- get burned by case insensitive filesystem
- repeat
There could be more, but I reformatted it again shortly afterwards.
Also, my use case is extremely simple. I'm just sharing my own personal projects between my desktop and my laptop. I only ever use one of the two at a time, and am not using any tool that automatically checks or updates git repos.
You bring up an interesting point though, I wonder if there's any kind of hack you could do to the dropbox config files to alter that?
Could you push to one bundle per computer and then git fetch all the bundles from your peers? Once all your peers have your changes, you can start making bundles from a later revision so that the incremental bundles aren't too big.
"You retain full ownership to your stuff. We don’t claim any ownership to any of it."
Or am I missing something?
There is also this snippet that was added, which assumes that your key isn't really private as opposed to services like SpiderOak which have no knowledge of your key:
> We may disclose to parties outside Dropbox files stored in your Dropbox and information about you that we collect when we have a good-faith belief that disclosure is reasonably necessary to (a) comply with a law, regulation or compulsory legal request; (b) protect the safety of any person from death or serious bodily injury; (c) prevent fraud or abuse of Dropbox or its users; or (d) protect Dropbox's property rights.