Live data from Hacker News

The beauty of Git in Dropbox

news.ycombinator.com

21–30 of 33 posts

Re: The beauty of Git in Dropbox

#21
post #6

This has been discussed before as a bad idea. Unless Dropbox has improved, you'd likely run into syncing issues like I did 6 months ago. On the other hand, the top voted answer on this SO question demonstrates how one might use a Dropbox directory as a git remote, so that you can push code there intermittently, preventing the trouble with constant writes to the Dropbox. http://stackoverflow.com/questions/1960799/usin…

Bonus: If you create bare repository in public you can clone(read-only) it with ease from anywhere.

Re: The beauty of Git in Dropbox

#23
I've been doing this exact setup for over a year now. I sync between three computers: office desktop, home desktop, and laptop (all three computers run Ubuntu 12.04). I'm very happy with this setup, although there have been problems.

The major benefit is that I don't have to remember to commit and push my changes before switching from one computer to another. When I'm leaving work, I'm often in a hurry; when I get home, all of my work comes with me. Same thing applies to travelling with my laptop.

The major problem is that Dropbox occasionally fails. Because I have come to rely heavily upon this setup, a failure causes significant pain. In my experience, Dropbox has failed in 2 ways.

1. I make some changes on computer A. Dropbox screws up when syncing the change to computer B. When I switch to computer B, I discover that the repository on computer B is messed up (HEAD has been updated, but not the working tree; or the local repository is messed up so that 'git status' fails; or something else bizarre). In this situation I must switch back to computer A, move the 'good' repository outside of Dropbox, wait for Dropbox sync to complete, move the repository back into Dropbox, wait for sync to complete, then finally switch back to computer B and wait for Dropbox sync to complete. You can imagine how this process would be extra painful when it requires you to commute back and forth between home and office for each step.

2. I make some changes on computer A. Dropbox has silently stopped syncing the repository on computer A. When I switch to computer B, I discover that none of the changes made on computer A have synced. In this situation, restarting Computer A usually causes the Dropbox sync to resume. Troubleshooting this situation follows a similar course to situation 1.

I have communicated with Dropbox support extensively about Situation 2, and I believe that it is related to the '10,000 folder limit' for Dropbox on Linux. See the section "Monitoring more than 10000 folders" on this page:

https://www.dropbox.com/help/145/en

Git uses a very large number of folders (usually around 1500) for each repository. This does not play well with Dropbox on Linux. When Situation 2 occurs, Dropbox gives every indication that it is working correctly; files that are not syncing show the "green checkmark", and the Dropbox tray icon shows "All files up to date". Troubleshooting Situation 2 was a thoroughly enraging experience.

A good precaution is to push your personal working branch to GitHub (or your remote repository of choice) as a backup when using this setup. Treat this remote branch as disposable; if you rebase your working branch, you can just delete the remote branch and push your rebased branch (`git push origin :my-working-branch`, `git push origin my-working-branch`).

So, there have been some serious issues, but altogether I am very happy with my setup. I like the flexibility of not having to commit and push changes when I'm switching from one computer to another, and in general I feel the daily benefits have outweighed the occasional problems.

Re: The beauty of Git in Dropbox

#24
I find that as long as you save files and make sure dropbox is "synced" before starting work on another machine, this setup works fantastically. I occasionally have Dropbox "conflict" files, but have never had an issue figuring out which versions to keep.

Re: The beauty of Git in Dropbox

#25
I keep my personal repos in Dropbox (then my working directory elsewhere) - I still have to push and pull when switching computers (and make sure Dropbox syncs), but it's worked out fairly well for me. You can share the Dropbox folder as a sort of poor man's private Github repo, but you need some sort of out-of-band communication to ensure that you don't push to it simultaneously.

Re: The beauty of Git in Dropbox

#26
post #20
post #19

I do this for several years with lots of repos. Not a single problem ever.

And I use different OSes – Mac OS X, Windows 7 and XP, sometimes different git versions. And still no problems.

So you never see conflict messages or conflicted files in your Dropbox? In the few cases I've tried a git working copy on Dropbox -- which is what I believe the author is discussing -- I've had conflicts.

For example:

    $ ls -1 .git/index*

    index
    index (blacktip.esquimaux.org's conflicted copy 2013-04-09)
    index (hammerhead's conflicted copy 2012-01-30)
    index (holodeck's conflicted copy 2012-01-26 (1))
    index (holodeck's conflicted copy 2012-01-26)
    index (holodeck's conflicted copy 2013-04-09)
It was only the index file and not anything irreplaceable (not that git does a lot of mutating of files in general). But it rapidly ended my experiment with git on Dropbox.

Re: The beauty of Git in Dropbox

#27
I've been doing something similar for the last couple of years (SVN and Ubuntu One rather than Git and Dropbox). In general it works very well but you need to ensure that both computers have properly synced before you switch working between them or you risk issues with conflicts and/or corrupted files. Also you should have a backup plan in case things go wrong. In my setup I only keep the working copy in Ubuntu One with the repo somewhere safer. This means if something doesn't work properly I can simply create a new working copy. I realise Git works a little differently but it is always worth ensuring you can recover from failure as Dropbox and equivalents are all slightly less reliable than traditional file storage. The final thing to bear in mind is that if this is for work, some employers will be unhappy about their proprietary code being hosted on the "cloud" rather than on computers they control.

Re: The beauty of Git in Dropbox

#29
I use a similar workflow with SVN to great effect. I have never had a sync issue - whether this is luck or that the repository structure is more robust in this setting than Git's, I don't know. I would strongly recommend against using this as a collaboration tool, though!

Re: The beauty of Git in Dropbox

#30
post #20

Earlier quoted context omitted.

And I use different OSes – Mac OS X, Windows 7 and XP, sometimes different git versions. And still no problems.

So you never see conflict messages or conflicted files in your Dropbox? In the few cases I've tried a git working copy on Dropbox -- which is what I believe the author is discussing -- I've had conflicts. For example: $ ls -1 .git/index* index index (blacktip.esquimaux.org's conflicted copy 2013-04-09) index (hammerhead's conflicted copy 2012-01-30) index (holodeck's conflicted copy 2012-01-26 (1)) index (holodeck's…

I used to see conflicts all the time
Post reply on HN