Studying the design document [1], one sentence makes it clear why this project is needed and simply using the Dropbox client does not suffice:<p>> We can perform a compare-and-swap operation in Dropbox by using the "update" write mode with a specific revision number.<p>Since a Git repository basically consists of a hash-addressed content object store alongside a mutable list of references (mapping branch names to hashes of latest commits), you need a compare-and-swap operation on the reference list to update the branch reference when you push new commits. The Dropbox client by design does not do a compare-and-swap whenever a file is updated, but the Dropbox API supports it.<p>[1] <a href="https://github.com/anishathalye/git-remote-dropbox/blob/master/DESIGN.rst" rel="nofollow">https://github.com/anishathalye/git-remote-dropbox/blob/mast...</a>
It's worth mentioning that it's also very easy to set up git for use over ssh just about anywhere (digitalocean, linode, VM or container at home, etc)<p>The official docs cover it pretty well:<p><a href="https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server" rel="nofollow">https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-...</a><p>If it's for your own use, you can skip the part about creating a `git` user, and host the files in eg `/home/$USER/repositories` instead. The repository setup instructions remain the same, just the path differs, and the `authorized_keys` file to add keys to will be in `/home/$USER` instead of `/home/git`.
Many people don't seem aware of AWS CodeCommit -- AWS hosted git. $1/user per month, 10GB storage, no bandwidth charges. Free for the first year.
> <i>Why shouldn't I keep a bare Git repository in a Dropbox shared folder, use it as a folder-based Git remote, and sync it with the desktop client?</i><p>> There seem to be some articles on the Internet suggesting that this is a good idea. It's not. Using the desktop client to sync a bare Git repository is not safe. Concurrent changes or delays in syncing can result in a corrupted Git repository.<p>How dangerous would this be in practice? Ie, what are the chances of corrupting a git repo with this method with a small team, and what exactly must happen to cause it?
Important thing to note — this may not be the best solution if your goal is to always have an up to date local (dropbox synced) version of a git repo. The docs discourage that:<p>> If you're using the Dropbox client to sync files, it's a good idea to use selective sync and disable syncing of the folder containing the repository to avoid any unexpected conflicts, just in case.<p>Also, in case this wasn't obvious, this is basically a "shim" to use dropbox as a git server (as opposed to say mercurial or SVN). No actual git server is being run and if I understand correctly, some useful features from a normal git server are not implemented.<p>> git-remote-dropbox is a Git remote helper.<p>> git-remote-dropbox stores all objects as loose objects - it does not pack objects. This means that we do not perform delta compression. In addition, we do not perform garbage collection of dangling objects.
> As far as I know, git-remote-dropbox is the only safe way to host a Git repository on Dropbox.<p>I've another hackish method that's good enough for a single developer, plus it's encrypted.<p>I've got a truecrypt file container that resides in Dropbox. I mount it as read-write when I want to push. On the rest of my machines, its mounted as read-only. Even if the container is 100GB, it takes 10 seconds to sync daily commits - because of block encryption & syncing. This won't work with Google / MS / Amazon drive etc. because they upload the entire container on each incremental change.
Reading through the code (20 second skim) it does not appear that this remote would reveal any information to the OP such as your dropbox access token or code being pushed.
I find it interesting that Dropbox isn't building these types of utilities themselves. This looks pretty cool and also seems like a really good way to up-sell Dropbox storage later.
Shameless plug: I've implemented something similar in the past, but with the addition of client-side encryption. I've been using it for some time without problems.<p>At a first glance at the design docs here, the present project looks more sophisticated in terms of syncing. I'm just using local file operations and hoping for dropbox to do its stuff :)<p><a href="https://github.com/lucas-clemente/git-cr" rel="nofollow">https://github.com/lucas-clemente/git-cr</a>
Syncthing (<a href="https://syncthing.net/" rel="nofollow">https://syncthing.net/</a>) as a git server would be cool too.<p>I use Syncthing to sync around my personal git repo between my machines. All pushes and pulls are instant. I don't have conflicts because I'm only working on one machine at a time. `git-remote-syncthing` would presumably be even better, allowing multiple simultaneous users.
I'm shamelessly using GitHub Desktop and loving it. I guess I'll pass on this project unless there is a way to point GD to a Dropbox-hosted repo.
If you understand how git works, you don't need a tool to do this, and especially not a python tool. Don't misunderstand me, I love no language more than Python. But putting a directory under Dropbox supervision is the easiest thing you can do. That doesn't change because it's name is ".git/".