git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Syncing a git working tree with Dropbox?

From
Cchombee <chombee@lavabit.com>
Date
Jan 13, 2010, 23:57 UTC
Message-ID
<20100113235718.GA7033@dulip>

I've heard of people keeping a bare repo in their Dropbox folder (https://www.dropbox.com/) and pushing to and pulling from it, letting Dropbox sync the bare repo between their machines. In other words using Dropbox as a form of hosting for a private git repo. What I want to do is sort of the other way around.

I keep on getting into the following mess: I have some changes in my working tree on machine A, I stop working on machine A and don't commit and push the changes (to my remote, 'central' bare repo) either because they're not ready yet, or I forget to commit or push. Later on I arrive at machine B which has its own clone of the same repo, but because I didn't commit and push the changes on machine A I don't have access to them on machine B and I can't continue working on them. The two machines are physically located far away from each other and they're not accessible over the internet. Argh!

Dropbox is a proprietary sync service that gets around this problem because it automatically syncs your files whenever you save them. But I still want to keep my project in a git repo. I'm assuming that keeping the actual .git folder in a Dropbox folder, so that when git makes changes inside the .git folder Drobox syncs them, would be a bad idea. It seems like taking two different synchronisation systems and mashing them into each other. But what about just the working tree?

My idea is that I keep my .git folder safely outside of my Dropbox folder, but my git repository has a detached working tree that is located in the Dropbox folder. On machine B it would be the same setup. So the two machines each have their own clone of the git repo and these are synchronised by git push and git pull with a 'central' remote repo. But the two clones share the same working tree, or more accurately their working trees are synced by Dropbox.

The working tree is just files, I don't see how it's different from Dropbox syncing any other files. Dropbox and git ought not to collide in any way. So this should work fine shouldn't it?

This way I don't need to commit and push my changes until they're ready/I remember to, but whenever I move from machine A to machine B my uncommitted changes will still be available to me because Dropbox has synced my working tree automatically.

Next: Tay Ray Chuan
Message 1 of 4 in “Syncing a git working tree with Dropbox?”
  1. chombeeJan 13, 2010
  2. Tay Ray ChuanJan 14, 2010
  3. Geoffrey LeeJan 14, 2010
  4. chombeeJan 14, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.