Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I mean, why not?

Because git combined with Dropbox and the likes can be slow, lead to broken repositories, mad sync conflicts and so on? At least that is what I've witnessed with colleagues. This was years ago though, and I assume you dont have these issues or maybe a different workflow, so this is more like a word of warning for others: test this properly first before just diving into it.



Hmm I haven't have significant issues for almost 10 years. And a few years ago Dropbox introduced a folder-level rewind feature so you can easily restore any broken folder.

Anyway, YMMV.


Yup, I’ve been running this config for personal projects for over 10 years too


Maybe if you shut a laptop while it's syncing and then start editing the same things on a different computer without considering that you should finish the sync, but that seems pretty niche.

Are you sure those people were using their own personal dropbox folders? If they were sharing with each other that's a different thing entirely and requires a lot more care to avoid problems.


Are you sure those people were using their own personal dropbox folders?

Yes, one single account.

while it's syncing and then start editing the same things on a different computer

IIRC this was one of the issues. Not necessarily because of shutting down, but just when using multiple computers one after the other and Dropbox not having synced in between. Not that niche depending on line of work, think lab-like setups where one thing gets deployed to multiple machines and deployment then gets tested. In one company the 'oh but you have to wait for dropbox to sync before doing that' and 'how?' responded by 'urm, yeah, check the timestamp on all files in that directory' was a rather common thing, often leading to stupid issues. Put git in the picture there and things won't get any better.


Oh, using it for deployment, so you're moving directly from one computer to another right after making a change and then using those files? I could see how that causes problems sometimes. I think the use case of "here is my checkout, I edit it on multiple computers, I don't use it as anything else" is a lot more reliable.


I think you're on to something here. It might be both safe and convenient to use git with Dropbox iff you create a bare git repo that is not in a Dropbox folder, and then specify a separate worktree that is in a Dropbox folder. That might give you the best of both worlds, but I haven't tested the idea.


There aren't any fundamental issues with putting the git repo in Dropbox. Under normal circumstances, to cause a conflict you'd have to do something that writes to the git folder, then switch computers, pull up the same checkout, and do something else that writes to the git folder, all within less than half a minute.

And even then it's just something like having disagreement about an index file. Easy to resolve.


The fundamental issue is that Dropbox changes are non-atomic w.r.t. what git considers "atoms." See my other comment in this thread. You're right that there's usually not a problem with a single contributor, but if you ever have two or more contributors sharing a Dropbox-contained repo it will be bad news.


Sure, don't share. But there's a good use case for putting a single-user checkout into Dropbox, and that's because it adds convenience and gives you continuous backups.

Though outside of garbage collecting, git doesn't have many files that actually get changed. Mainly the ref pointers which are easy to resolve and the logs which aren't very important.


I've done this in the past but stopped. The problem is there are no atomic transactions in Dropbox. If two people are pushing changes to a repo at the same time using only git, it's not a problem because git understands atomic transactions. But if that repo happens to be in Dropbox all hell can break loose because the various files inside the .git directory are not being synched atomically.

A git repo in Dropbox can appear to work okay with a single contributor where that contributor is only working on one computer at a time. But as soon as you add a second contributor, you very much should take Dropbox out of the process.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: