Hacker News new | ask | show | jobs
by calculus 5203 days ago
Am I wrong, or does pushing to the dropboxed git repo at the same time from two different computers will corrupt the repo ?
4 comments

I managed to screw up a git repo in Dropbox. I believe it was by making a commit on a non-connected computer than making another commit before the first one had synced to dropbox.

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.

Even if you do screw it up, the commit should all be there and valid. The only thing that happens is HEAD won't point to the right commit on other boxes, and then when you do sync you'll clobber the file containing the commit for HEAD, thus losing the other commits. Fortunately, they'll still exist until a gc occurs, so you can go find them in reflog.
Correct, I still had my HEAD files, but everything else seemed pretty broken. I'm not a Git expert by a long shot, but I would imagine that Dropbox renamed some files like "Foo.bar (Eli's Conflicted Copy)" and that really confused the history.

Anyway, not something I would recommend.

If you have multiple users use different branches, I think this page was written from the perspective of a single coder that needs to keep track of his own code in a safe way.
For a single coder, I see no problems.
Hope to not be wrong, but if you push different commits you should be safe.
It can, yes. It's relatively rare though. The nice thing about git is that, when it happens, you can just nuke the Dropbox repository and rebuild it without losing anything. Git's checksums guarantee that the corruption results in an error and not bad data.