Mercurial (and, I guess Git) with Dropbox: any dra

2019-01-07 08:18发布

I have a Mercurial repository for a personal project, and I have been storing the master repository in my Dropbox for a few weeks now (something along this line; and I understand it's also possible with git).

The idea is that it serves both as a way to work with multiple machines and as a remote backup. I clone the repository and work on the non-Dropbox copy, and only push updates once in a while, the same way I would, I suppose, work with Bitbucket.

Can you think of any drawbacks to this idea, compared to using dedicating hosting (BitBucket in the case of Mercurial)? I know Bitbucket has free accounts for single users, which is great, but they are limited to 150M, which isn't a huge.

In particular, is it possible that Dropbox's sync process would corrupt the repository? I had to run hg recover once on the master repository, but it might be unrelated (and anyway it happily recovered). Does anyone have a bad experience with the idea? Does anyone have a longer good experience and can alleviate my worries? Does anyone have an opinion based on better understanding of the internals of these things?

edit: I added some clarifications to the questions. They are in italics.

10条回答
Luminary・发光体
2楼-- · 2019-01-07 08:27

I've had problems with my Dropbox'ed repositories becoming corrupted. It doesn't happen all the time, but the fact that it has happened more than once means that I'm going to stop using Dropbox for this purpose.

That said, Dropbox is certainly cheaper than getting real hosting, so as long as you keep backups you may find it acceptable for personal projects.

查看更多
Explosion°爆炸
3楼-- · 2019-01-07 08:27

I've been using Dropbox with Hg too without experiencing a problem until now. Too late I realized hg doesn't report corruption during routine checkins, only when you try to use the repo for real (the worst of all situations, since you don't know something's broken until you really need it).

Its not clear whether if the corruption is spontaneous or caused by accessing the repository with Mac, Windows and Linux clients (I use all three at different times). But I've seen at least one case of corruption happening when only the Mac was active so it could well be Dropbox itself.

If you do decide to live dangerously, run "hg verify" (or "git verify" regularly to turn up any dirt.

查看更多
时光不老,我们不散
4楼-- · 2019-01-07 08:28

I'd expect problems if you try to access repository in the middle of the sync. It also seems to be a bit of overhead. You don't really need to sync over the stuff you sync. I have no idea how dropbox handles conflicts, but I doubt it can do it in an scm-aware way.

查看更多
神经病院院长
5楼-- · 2019-01-07 08:28

I've been using Dropbox with git for personal projects for quite some time now, and I haven't had a single problem yet. Although, there are times you have to wait for Dropbox to sync. I think this can cause minor problems if there are more than a few people working on the same project, but for personal projects, I find Dropbox to be even better than GitHub, if only for the fact that pushing/pulling is faster.

As for pushing/pulling mid-sync, this will most probably cause problems, and it might even corrupt your repo, but if you're the only one working on the project, then you know exactly when Dropbox will sync.

查看更多
Summer. ? 凉城
6楼-- · 2019-01-07 08:31

I would not recommend using dropbox with mercurial, as I often see conflicted files between my Mac and Windows clients. Especially undo is affected, but I did experience conflicts with other files as well.

Regards Mirko

查看更多
趁早两清
7楼-- · 2019-01-07 08:31

I am using it with Bazaar at the moment across 3 machines. However, I am the lone developer in any of the branches.

I used the init-repo --no-trees command to create the repository.

查看更多
登录 后发表回答