TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The beauty of Git in Dropbox

22 pointsby alexeichemendaabout 12 years ago
I have been debating with friends about the power of git merged to the simplicity of Dropbox.<p>Hear me out. I can see a very cool feature when using git within a dropbox folder.<p>Imagine you are working on several computers (one at home, one at work, one laptop). With git, you can (obviously) pull to get the latest version of your branch on all your devices. But if you put your git repo on dropbox, you just fire your laptop on and your project will be up to date !<p>What do you think about this workflow ? Would you do this ? Do you see any problems with this usage ? I would love to hear more.

22 comments

tbesedaabout 12 years ago
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.<p>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.<p><a href="http://stackoverflow.com/questions/1960799/using-git-and-dropbox-together-effectively" rel="nofollow">http://stackoverflow.com/questions/1960799/using-git-and-dro...</a>
评论 #5559182 未加载
评论 #5569599 未加载
评论 #5559234 未加载
lmmabout 12 years ago
This is not a good idea. Dropbox has its own notion of how to resolve conflicts, while git spreads its repository over several files; if you commit from two machines at the same time it is entirely plausible it will corrupt your repository. If your only goal is to have your git repository "autopull" it'd be pretty easy, and much safer, to script that
maxhowellabout 12 years ago
I have for about a year now done all my work out of Dropbox (via a symlink from ~/src) it works great for multiple machines and has added advantages, eg. I never worry about deleting files that aren't staged anymore, as I can undo the delete from Dropbox’s website.<p>Git is for long-term version control, working out of Dropbox is like having a script running that stashes and unstashes every change you make so that its in the git-reflog.
评论 #5559084 未加载
rjohnstoneabout 12 years ago
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.
ianoxabout 12 years ago
I've created bare git repositories on Dropbox before and haven't had any problems using them as git remotes. They've only been used by me though, so things might get more tricky if you need multi-user access.<p>A few have mentioned syncing issues, so if you try the Dropbox approach, think about what the worst that could happen might be? If you can live with that, then give it a go. You can always setup other git remotes for GitHub and / or Bitbucket as well, in addition to a Dropbox remote, if you worried about syncing issues (although you'd obviously have to manually push / pull to these).
snowwrestlerabout 12 years ago
When you save to Dropbox, you're just saving to your local machine. Then the Dropbox app pushes the changes to the Dropbox server. When you wake up or turn on another authorized computer, the Dropbox app on that machine polls the Dropbox server, and pulls the changes.<p>Conceptually, it's the same as using a hosted git remote repo, like Github. The only thing it saves you is having to type the git push and pull commands...not a huge savings IMO.<p>Besides that, the only advantage I can see is that the Dropbox process is private by default, whereas Github repos are public unless you pay.
philipashlockabout 12 years ago
You might also be interested in SparkleShare which replicates the functionality of Dropbox using Git <a href="http://sparkleshare.org/" rel="nofollow">http://sparkleshare.org/</a>
BruceIVabout 12 years ago
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.
C0d3rabout 12 years ago
Have you seen <a href="http://git-annex.branchable.com/" rel="nofollow">http://git-annex.branchable.com/</a>?
strangestchildabout 12 years ago
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!
agibabout 12 years ago
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.
sirchristianabout 12 years ago
I've used Mercurial over Dropbox before and would caution against it. Somehow the repository got corrupted (I'm betting on a bad Dropbox sync) and then all the repositories got corrupted. Since then moved to bitbucket.
dev344about 12 years ago
I used this approach for my class projects a couple of years ago. It served the purpose pretty well. I used github to mainly collaborate with others while dropbox to use on different(lab/home) machines of mine.
Poyeyoabout 12 years ago
Sounds quite an interesting idea... make a git client that acts like dropbox.
burrowsabout 12 years ago
The convergence of dropbox and git was some of the initial inspiration for <a href="http://projectmeadow.com" rel="nofollow">http://projectmeadow.com</a> .
jdbevanabout 12 years ago
I already successfully use this method between my work laptop (Windows 7) and my home laptop (Ubuntu 11.04) and haven't run into any problems yet!
gesmanabout 12 years ago
I do exactly that (syncing multiple computers with my work-in-progress files and data) with bitbucket.org.<p>Not sure why would i need to add dropbox to equation?
fenivabout 12 years ago
It is also worth noting that Dropbox saves its own revision history automatically, just like Google Docs.
评论 #5559120 未加载
degorovabout 12 years ago
I do this for several years with lots of repos. Not a single problem ever.
评论 #5559224 未加载
wesllyabout 12 years ago
I'm confused, how is this better than just using github or bitbucket?
评论 #5559108 未加载
dullroarabout 12 years ago
Use a similar approach, except with Mercurial. It works. :)
jmlacodaabout 12 years ago
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.<p>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.<p>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.<p>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.<p>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.<p>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:<p><a href="https://www.dropbox.com/help/145/en" rel="nofollow">https://www.dropbox.com/help/145/en</a><p>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.<p>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`).<p>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.