TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Dropbox as a Git Server

284 点作者 anishathalye大约 9 年前

18 条评论

rav大约 9 年前
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>&gt; We can perform a compare-and-swap operation in Dropbox by using the &quot;update&quot; 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:&#x2F;&#x2F;github.com&#x2F;anishathalye&#x2F;git-remote-dropbox&#x2F;blob&#x2F;master&#x2F;DESIGN.rst" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;anishathalye&#x2F;git-remote-dropbox&#x2F;blob&#x2F;mast...</a>
评论 #11567409 未加载
GrinningFool大约 9 年前
It&#x27;s worth mentioning that it&#x27;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:&#x2F;&#x2F;git-scm.com&#x2F;book&#x2F;en&#x2F;v2&#x2F;Git-on-the-Server-Setting-Up-the-Server" rel="nofollow">https:&#x2F;&#x2F;git-scm.com&#x2F;book&#x2F;en&#x2F;v2&#x2F;Git-on-the-Server-Setting-Up-...</a><p>If it&#x27;s for your own use, you can skip the part about creating a `git` user, and host the files in eg `&#x2F;home&#x2F;$USER&#x2F;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 `&#x2F;home&#x2F;$USER` instead of `&#x2F;home&#x2F;git`.
评论 #11566773 未加载
wrong_variable大约 9 年前
&gt; I ran out of private GitHub repositories a long time ago<p>why doesn&#x27;t OP use bit-bucket ?
评论 #11564913 未加载
评论 #11564840 未加载
评论 #11564918 未加载
评论 #11564855 未加载
评论 #11564898 未加载
评论 #11564861 未加载
评论 #11567026 未加载
tacos大约 9 年前
Many people don&#x27;t seem aware of AWS CodeCommit -- AWS hosted git. $1&#x2F;user per month, 10GB storage, no bandwidth charges. Free for the first year.
评论 #11569277 未加载
评论 #11567494 未加载
jonahx大约 9 年前
&gt; <i>Why shouldn&#x27;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>&gt; There seem to be some articles on the Internet suggesting that this is a good idea. It&#x27;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?
评论 #11564922 未加载
评论 #11565041 未加载
评论 #11565307 未加载
评论 #11565493 未加载
评论 #11565150 未加载
评论 #11564907 未加载
avivo大约 9 年前
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>&gt; If you&#x27;re using the Dropbox client to sync files, it&#x27;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&#x27;t obvious, this is basically a &quot;shim&quot; 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>&gt; git-remote-dropbox is a Git remote helper.<p>&gt; 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.
评论 #11566200 未加载
sourcd大约 9 年前
&gt; As far as I know, git-remote-dropbox is the only safe way to host a Git repository on Dropbox.<p>I&#x27;ve another hackish method that&#x27;s good enough for a single developer, plus it&#x27;s encrypted.<p>I&#x27;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 &amp; syncing. This won&#x27;t work with Google &#x2F; MS &#x2F; Amazon drive etc. because they upload the entire container on each incremental change.
评论 #11565366 未加载
0xCMP大约 9 年前
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.
joeblau大约 9 年前
I find it interesting that Dropbox isn&#x27;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.
评论 #11566173 未加载
lclemente大约 9 年前
Shameless plug: I&#x27;ve implemented something similar in the past, but with the addition of client-side encryption. I&#x27;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&#x27;m just using local file operations and hoping for dropbox to do its stuff :)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;lucas-clemente&#x2F;git-cr" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lucas-clemente&#x2F;git-cr</a>
meonkeys大约 9 年前
Syncthing (<a href="https:&#x2F;&#x2F;syncthing.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;syncthing.net&#x2F;</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&#x27;t have conflicts because I&#x27;m only working on one machine at a time. `git-remote-syncthing` would presumably be even better, allowing multiple simultaneous users.
chmaynard大约 9 年前
I&#x27;m shamelessly using GitHub Desktop and loving it. I guess I&#x27;ll pass on this project unless there is a way to point GD to a Dropbox-hosted repo.
评论 #11568107 未加载
amalag大约 9 年前
Many people don&#x27;t realize it but you can store git repos in S3 using jgit. Super cheap backups of git repos.
KayL大约 9 年前
Storing massive small files in Dropbox folders is horrible! It burns my SSD &amp; CPU on each restart.
nallerooth大约 9 年前
People still use Dropbox for this? I guess I shouldn&#x27;t have stopped developing this 4 years ago.
alediaferia大约 9 年前
Why?
评论 #11565660 未加载
评论 #11564931 未加载
评论 #11565436 未加载
_ZeD_大约 9 年前
What&#x27;s wrong with a simple svn server?
评论 #11569538 未加载
erikb大约 9 年前
If you understand how git works, you don&#x27;t need a tool to do this, and especially not a python tool. Don&#x27;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&#x27;t change because it&#x27;s name is &quot;.git&#x2F;&quot;.
评论 #11567237 未加载