将 Subversion 与 DropBox 结合使用
使用 Dropbox 作为 Subversion 存储库的备份系统是一个坏主意吗?
有人尝试过将 Subversion 与 Dropbox 这样的在线文件共享实用程序一起使用吗?你有什么经历?
我关心的是这是否有效 - 主要是因为 Subversion 维护锁并且它对此非常具体。我不确定 Dropbox 和 Subversion 是否可以一起工作?
ps 我正在考虑将其用于我的 Xcode 项目,不,我不想使用 github,因为它不是免费的 - 你不能使用免费帐户将你的存储库保持私有(以及其他原因)。
参考资料:
Dropbox(文件同步、共享和在线备份)
Subversion(开源版本控制系统)
Is it a bad idea to use Dropbox as a backup system for Subversion repositories?
Has anyone tried using Subversion with an an online file sharing utility like Dropbox? What's your experiences?
My concern is whether this will work - mainly because Subversion maintains locks and it's very specific about it. I'm not sure if Dropbox and Subversion can both work together?
p.s. I'm thinking of using this for my Xcode projects, and no, i don't want to use github because it's not free - you can't keep your repositories Private with the free account (and other reasons).
References:
Dropbox (file sync, sharing, and online backup)
Subversion (open source version control system)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
我的 Dropbox、SVN 和 Xcode 都运行良好,从来没有遇到过任何问题。
您甚至不需要小心从哪台机器提交/更新,因为 Dropbox 会保持一切同步。
I've got Dropbox, SVN and Xcode working fine here, I've had no problems what so ever.
You don't even need to be careful about which machine you commit/update from as Dropbox keeps EVERYTHING synchronised.
我的建议是将 dropbox 与加密工具(例如 TrueCrypt)一起使用。这样您就可以在云端拥有安全的存储空间。
SVN 在 TrueCrypt 磁盘中完美运行。
如果您需要在多个位置同时访问存储库,我建议使用 Subversion 主机提供商。如果两个人同时修改同一个文件,DropBox 可能会感到困惑。
http://wiki.dropbox.com/TipsAndTricks/IncreasePrivacyAndSafety
http://www.randomwire.com/storing-sensitive-data-in-the-cloud
My suggestion is to use dropbox together with an encryption tool such as TrueCrypt. In this way you would have a safe storage on the cloud.
SVN works perfectly in a TrueCrypt disk.
If you need to access the repository at the same time on multiple location I would recommend of using a subversion host provider. DropBox can get confused if two persons are modifying the same file at once.
http://wiki.dropbox.com/TipsAndTricks/IncreasePrivacyAndSafety
http://www.randomwire.com/storing-sensitive-data-in-the-cloud
为什么要在 Dropbox 中使用 SVN?相反,您可以使用自己的 SVN 服务器和类似 Dropbox 的界面:来自 Assembla 的 EasySVN 或IQBox-SVN。
Why to use SVN inside Dropbox? Instead, you can use your own SVN server with Dropbox-like interface: EasySVN from Assembla or IQBox-SVN.
也许这会对你有所帮助。我已将 SVN Reposiroty 放入 Dropbox 文件夹中。 http://foyzulkarim.blogspot.com/2012/12/dropbox -as-svn-repository.html
May be this will help you. I have put SVN Reposiroty inside of a Dropbox Folder. http://foyzulkarim.blogspot.com/2012/12/dropbox-as-svn-repository.html
您可以简单地从 Dropbox 中排除 .svn-Folder:(适用于 Mac 的说明)
您需要查看 .svn-Folder,因此进入终端并执行
转到您的文件夹并将 .svn-Folder 复制到其他位置
转到您的 Dropbox-Preferences >高级>选择性同步并停用到 .svn-Folder
该文件夹现在应该已从您的 HD 和 Dropbox 中删除,您可以在网站上查看。
将 .svn-Folder 的副本放回目录中。您应该看到一个小灰色符号,如 (-)
Revert step 1 with
就这样!
You can simply exclude the .svn-Folder from Dropbox: (instructions for Mac)
You need to see the .svn-Folder, so go into Terminal and execute
Go to your Folder an Copy the .svn-Folder somewhere else
Go to your Dropbox-Preferences > Advanced > Selective Sync and deactivate to .svn-Folder
The Folder should now be deleted from your HD and Dropbox, you can check that on the website.
Put your copy of the .svn-Folder back into the directory. You should see a little gray sign like (-)
Revert step 1 with
That's it!
我认为如果您不从不同位置访问存储库,并且在使用它之前进行同步,那么它可能会正常工作。但这似乎不是一个非常稳定的解决方案。
您是否有任何原因无法为您的存储库提供公开可用的 URL?
I think it will probably work out OK if you're not accessing the repository from different locations, and let is synchronize before using it. It doesn't seem like a very stable solution though.
Is there any reason you can't us a publicly available URL for your repository?
根据您同步的文件数量,最终可能会进行大量文件传输。 (请记住,您在 Dropbox 上只有 200MB,免费帐户上没有任何额外的存储奖励。)这意味着所有 .svn(或 _svn)文件也将同步,实际上使需要保持更新的文件量增加了一倍。
如果初始同步完成后您不需要在树中移动整个目录,那么传输应该是可以接受的。
我自己在一些项目中尝试过这种方法,效果还不错,但最终我认为结合使用 Subversion 存储库和 Dropbox 的最佳方法是使用它们进行部署构建。我不会只是将 Dropbox 设置为与我的工作文件夹同步。使用 Dropbox 在一天结束时进行同步,按计划的时间间隔将工作文件夹复制到实际的 Dropbox 文件夹,从而限制前者可能产生的持续网络流量。
Depending on how many files you are syncing it may end up doing a lot of file transferring. (Remember, you only have 200MB on Dropbox without any additional storage bonuses on the free account.) This means all the .svn (or _svn) files will also be synced, in effect doubling the amount of files it needs to keep updated.
If you don't need to move whole directories around in your tree once the initial sync is complete, then transfers should be respectable.
I've tried this myself for some projects and it worked okay, but in the end I think the best way to use Subversion repositories and Dropbox together is to use them for deployment builds. I wouldn't just set Dropbox to sync with my working folder. Use Dropbox to sync up at the end of the day by copying in the working folder to the actual Dropbox folder at scheduled intervals, thereby limiting the amount of constant network traffic the former might incur.
我在使用 Dropbox 同步 svn 存储库时遇到问题,
一旦 Dropbox 无法访问某个文件,该文件就不会再次同步。
然后,svn结构就被破坏了......
i got problems when use Dropbox to sync svn repository,
once Dropbox failed to access one file, the file doesn't be synced again.
then, the svn structure was been destroyed...
请参阅SVN 备份到 Dropbox。这会生成 SVN 存储库的完整或增量转储,并将压缩结果上传到 Dropbox。这种方法的主要优点是它不使用 Dropbox 客户端软件。 Dropbox 客户端软件会在您的计算机和云之间进行同步,并且损坏的文件也会被同步。您可以创建一个 cronjob(或 Windows 计划任务)来每天/每周/每月等运行此脚本。
See SVN Backups to Dropbox. This generates full or incremental dumps of the SVN repository and uploads the compressed result to Dropbox. The main advantage of this approach is that it does NOT use the Dropbox client software. The Dropbox client software synchronizes between your computer and the cloud, and a corrupted file would be synchronized. You can create a cronjob (or Windows scheduled task) to run this script every day/week/month/etc.
这不是一个简单的方法...
第一个想法总是“好吧,让我们将存储库保留在 Dropbox 上,剩下的事情它会完成”。没有。正如您所期望的那样,这个组合总是会给您带来锁定问题。我尝试过,因为我喜欢 svn 的简单性,但最终我将一些存储库移至 git,只是为了使同步完美无缺。
现在我仍然不是 git 粉丝(由于我客户的版本控制选择,在不可避免地使用了几年之后),所以这里有一些想法,可以不做我所做的事情:
你可以做什么
RiouxSVN
有一个非常好的(而且令人惊讶的是免费的)svn 托管服务: https://riouxsvn.com/ - 这是一个将存储库保存在安全的地方,与计算机物理分离,只要有连接就可以在任何地方使用,这是一种简单的方法。基本上,我猜您想通过 DropBox 实现什么目标。
提交后
您可以轻松创建提交后批处理,将本地存储库复制到 DropBox。让它成为一个微分镜,一个名为“robocopy”的内置工具可以为您解决这个问题。这样你就永远在天空中拥有一个安全的实例。
分散 DropBox 同步
如果其他方法似乎不起作用的话,这只是一个肮脏的伎俩 - 带有大文件副本的预提交挂钩,会导致 DropBox 明显延迟并阻止同时打开 svn 正在处理的相同文件。如果您有更好的选择,则不推荐。
更新 2022
再次尝试 SVN + Dropbox,到目前为止没有问题
更新 2023
自更新 2022 以来它一直有效
Not the trivial way...
First idea is always "okay, let's keep the repo on Dropbox and it will do the rest". Nope. This combo will always give you locking problems, just as you expected. I tried because I love svn's simplicity but I ended up moving some of my repos to git, just to make the sync flawless.
Now I'm still not a git fan (after a few years of inevitable use because of my clients' version control choices) so here's a few ideas to not do what I did:
What you can do instead
RiouxSVN
There's a very good (and surprisingly, free) svn hosting service: https://riouxsvn.com/ - it's a no-nonsense way to keep your repos somewhere safe, physically detached from your computer, available anywhere as long as you have a connection. So basically, what I guess you wanted to achieve with DropBox.
Post-commit
You can easily create a post-commit batch that copies your local repository to DropBox. Make it a differential mirror, a built-in tool called robocopy can take care of that for you. This way you'll always have a safe instance in the sky.
Distract DropBox sync
This is merely a dirty trick if nothing else seems to work - a pre-commit hook with a big file copy, to cause a noticeable delay for DropBox and prevent simultaneous opening of the same files svn are working on. Not recommended if you have a better option.
UPDATE 2022
Trying SVN + Dropbox again, so far no problems
UPDATE 2023
It works ever since update 2022