是否有可能使用Dropbox托管一个裸露的Git存储库,以共享代码? [英] Is it possible to host a bare Git repository using Dropbox, to share code?

查看:89
本文介绍了是否有可能使用Dropbox托管一个裸露的Git存储库,以共享代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到有类似的问题,但我的问题略有不同: m想知道通过多台计算机上的同步Dropbox文件夹共享裸存储库是否可以通过Git共享代码?



<换句话说:通过Dropbox共享一个Git仓库,就像通过SSH或HTTP共享一个集中位置一样



repo会在每个人的本地驱动器上更新吗?这与通过共享网络驱动器共享Git仓库相同吗?



注意: 经验问题:它似乎工作正常。我在问Git仓库的结构是否与这种共享方式兼容。

编辑为了澄清/重复,我正在讨论如何将Dropbox上的Git存储库保存为 / EM> 即可。我不是在谈论如何在Dropbox中保留源代码控制下的实际文件。

解决方案

我很确定这个是不安全的。 Git存储库中有很多移动部件,而Dropbox可能很容易破坏其中的一部分。例如,如果 refs 目录中的分支提示(主目录等)不正确,或者如果 objects / info / packs 文件有错误的内容。 Git repos非常简单且强大,但它们不仅仅是不可破解的存储。



通过SSH,git或HTTP访问远程存储库,甚至在本地网络文件系统是安全的,因为只能通过 git 进程访问存储库,这可确保将所有内容按正确的顺序移动到位。但Dropbox对订购没有任何保证,所以您可能会丢失数据。



只需使用Git服务器(或任何SSH服务器)没有, GitHub Bitbucket GitLab 想到。它会为您节省很多麻烦,而且使用Dropbox共享的本地存储库并不难(使用SSH URL而不是本地路径)。


I realize that there are similar questions, but my question is slightly different: I'm wondering whether sharing a bare repository via a synchronized Dropbox folder on multiple computers would work for sharing code via Git?

In other words: is sharing a Git repo via Dropbox the same as sharing it from one centralized location, for example, via SSH or HTTP?

Does the repo get updated on each person's local drive? Is this the same as sharing a Git repo via a shared network drive?

Note: This is not an empirical question: it seems to work fine. I'm asking whether the way a Git repo is structured is compatible with this way of sharing.

EDIT To clarify/repeat, I'm talking about keeping the Git repository on Dropbox as a bare repository. I'm not talking about keeping the actual files that are under source control in Dropbox.

解决方案

I'm pretty sure that this is unsafe. There's a bunch of moving parts in a Git repository, and Dropbox could easily wreck one of them. For example, you might end up with incorrect branch tips (master, etc.) in the refs directory, or your object store might stop working if the objects/info/packs file has the wrong contents. Git repos are fairly simple and robust, but they are not just dumb unbreakable storage.

Accessing remote repositories through SSH, git, or HTTP, or even locally on a network file system, is safe because the repository is only accessed through a git process, which makes sure that everything is moved into place in the right order. But Dropbox doesn't make any kind of guarantees about ordering, so you might lose data.

Just use a Git server (or any SSH server) instead -- if you don't have one, GitHub, Bitbucket or GitLab come to mind. It'll save you a lot of trouble, and it's no harder to use than a local repository shared through Dropbox (you just have SSH URLs instead of local paths).

这篇关于是否有可能使用Dropbox托管一个裸露的Git存储库,以共享代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆