4 ms·
> Why shouldn't I keep a bare Git repository in a Dropbox shared folder, use it as a folder-based Git remote, and sync it with the desktop client? > There seem
by jonahx 11y ago
> Why shouldn't I keep a bare Git repository in a Dropbox shared folder, use it as a folder-based Git remote, and sync it with the desktop client?
> There seem to be some articles on the Internet suggesting that this is a good idea. It's not. Using the desktop client to sync a bare Git repository is not safe. Concurrent changes or delays in syncing can result in a corrupted Git repository.
How dangerous would this be in practice? Ie, what are the chances of corrupting a git repo with this method with a small team, and what exactly must happen to cause it?
- tlarkworthy 11y agoIt's not an issue at all and all the articles saying otherwise are FUD. http://edinburghhacklab.com/2012/11/when-git-on-dropbox-conflicts-no-problem/ http://edinburghhacklab.com/2012/11/when-git-on-dropbox-conf... Edit: Wow I got downvoted and I actually ran the experiments myself. Has anyone got experiments showing otherwise?
- justinhj 11y agoI didn't downvote you, but I don't really agree this is not an issue. The article itself shows that the git repo can get into a confused state which you have to fix, even if the fix is simple. The experiment itself doesn't emulate common causes of Dropbox pain. Firstly Dropbox stores and syncs files in a way that gits number of files and layout of files is not kind to, causing thrashing and high cpu when people commit. Different clients have different ways of locking a git repo. Issues occur when two clients make changes and are online at different times. I'm not saying everyone will hit these issues, but these are all issues that someone has run into.
- bognition 11y agoI don't have any hard numbers but I tried using Dropbox as a git remote a few years ago. Everything worked great until it didn't. A HN discussion from a few years ago suggests that Dropbox + GIT is a mixed bag: https://news.ycombinator.com/item?id=5558822 https://news.ycombinator.com/item?id=5558822
- elithrar 11y agoI use this for some OSS projects I help maintain (symlinks in Dropbox, actual dirs on my GOPATH, etc.). The use-case for me is syncing between my laptop & desktop without having to remember to git pull everything before a flight/trip. There are occasional conflicted copies (once every few months), but it's rare and I don't recall encountering one in quite some time (months). Tips: * Don't work on things concurrently * It's brittle (like any sync service) if you're editing things when that folder is still updating. This is especially so when it comes to git. * Repositories with lots of small files take a long time to sync.
- mikeash 11y agoEven if it were possible to corrupt the repository, corruption would result in obvious failures rather than subtle data loss because of git's use of cryptographic hashes for everything, and the fact that local copies are full repositories makes it easy to nuke the Dropbox repository and recreate it if you need to.
- Grue3 11y agoI use this method by myself, and even then I had conflicts where Dropbox would fail to sync for some reason and then I would have git tree conflicts. But this not a big problem, since Dropbox saves both versions of conflicting files and you can just delete the conflicting copies, and then merge changes normally using git.
- wodenokoto 11y agoDangerous enough that the Dropbox client will give you a warning if you try to add a git repo to your dropbox folder.