如何在“多个(数千个)项目”中使用 Git在一个仓库中?

发布于 2024-12-11 03:29:07 字数 643 浏览 0 评论 0原文

我们有一个大型 SVN 存储库,其中包含多个项目。类似于 - http://plugins.svn.wordpress.org/

我们的存储库稍微复杂一些,因为它也有多个级别的“项目”!我们计划迁移到 Git。

我担心的是 - 我听说 Git 不允许你处理部分存储库(基于 PATH) 因此,即使我需要处理 http://plugins.svn.wordpress.org/rtsocial/trunk,整个存储库也会被下载。这是真的吗?有什么解决方法吗?

我们计划使用 GitHub,因此我们无法为所有项目制定包含数千个私人存储库的购买计划。我们更喜欢将大部分项目保存在一个大的存储库中,因为项目非常小(wordpress 主题、wordpress 插件等)

除了 GitHub 计划限制之外,我想管理 1000 个存储库将是一项艰巨的管理任务(我们有超过 40 个用户)在 SVN 中,并且每个月都会添加一些)

有什么办法可以继续使用 Git 还是我们应该只使用 SVN? 顺便说一句,如果 Git 更喜欢“一个项目 = 一个存储库”,是否有任何替代 GitHub 的方法,允许“无限私有”存储库?

提前感谢大家的帮助。

We have a big SVN repo with multiple projects in it. Something like - http://plugins.svn.wordpress.org/

Our repo is slightly more complicated since it has "project" at multiple-levels as well! We are planning to move to Git.

My concern is - I heard Git doesn't allow you to work on partial repos (based on PATH)
So even if I need to work on say http://plugins.svn.wordpress.org/rtsocial/trunk, the entire repo will get downloaded. Is this true? Is there any workaroud for this?

We are planning to use GitHub so we cannot afford to have buy plans with 1000s of private repos for all our projects. We prefer keeping our most of projects in one big repo since projects are very small (wordpress theme, wordpress plugin, etc)

Apart from GitHub plans restriction, managing 1000s of repos will be a big administrative tasks I guess (we have more than 40 users in SVN and every month few more gets added)

Is there any way to go ahead with Git or should we stay with SVN only?
On sidenote, if Git prefers "one project = one repo", any alternative to GitHub where "unlimited private" repos are allowed?

Thanks all for help in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

绝不放开 2024-12-18 03:29:07

在 git 中,您应该考虑为每个项目设置单独的存储库。您所说的“克隆”整个存储库以获得单个项目是正确的,并且没有解决方法。 (不要与稀疏结帐等术语混淆 - Git 中的术语结帐与 SVN 中的术语不同。)。 Git 中不存在像 SVN 中那样仅克隆特定文件夹的概念。

然而,由于您提到项目很小,因此您可以对其中一些项目进行逻辑分组,例如主题等。

您还可以查看 BitBucket,它允许您拥有无限制的免费私人 Git 存储库。或者您可以将存储库托管在您自己的服务器上,这非常简单。使用gitolite之类的东西,您可以非常轻松地管理和维护许多存储库。

In git, you should look at setting up separate repos for each of your project. What you said about "cloning" the entire repo to get a sinle project is correct, and there are no workarounds for it. ( don't get confused with terms like sparse checkout etc. - the term checkout is different in Git than from SVN. ). There is no concept of cloning only a particular folder in Git, like one can in SVN.

Since you mention projects are small, however, you can group some of them logically, like themes etc.

You can also look at BitBucket, which allows you to have unlimited free private Git repositories. Or you can host the repos on your own server, it is pretty straightforward. With something like gitolite you can pretty easily administer and maintain many repos.

筑梦 2024-12-18 03:29:07

我担心的是 - 我听说 Git 不允许你处理部分存储库(基于 PATH)所以即使我需要处理 http://plugins.svn.wordpress.org/rtsocial/trunk,整个存储库将被下载。这是真的吗?有什么解决办法吗?

是的。您不能仅签出存储库的一部分

每个项目使用一个存储库。没有其他明智的方式来组织事物。您可以通过子模块实现层次结构,这允许您将单独的存储库作为不同存储库的“子项目”包含在内。

Git 依赖于合理的内容边界才能正常工作。如果您尝试将“数千个”项目转储到单个 Git 存储库中,那么您肯定会遇到绝对无法控制的灾难。

最后一点,Git != GitHub。您不需要为 GitHub 上的 Git 托管付费才能使用 Git,而且我不明白为什么您会这样做,因为您显然不打算使用 GitHub 的任何社交编码功能和 1000+ 私有存储库。

任何机器都可以托管 Git 存储库,供人们进行推送和拉取。为什么不将“数千个”存储库安装到办公室某处的廉价基于 Linux 的服务器上呢?任何具有足够硬盘空间来容纳项目的设备都可以,一台具有 100GB 硬盘的 10 年旧机器就可以完成这项工作。

顺便说一句,如果 Git 更喜欢“一个项目 = 一个存储库”,是否有任何替代 GitHub 的方法,允许“无限私有”存储库?

GetHub 出售许可和安装其软件本地副本的功能,称为 GitHub Firewall。您将能够配置无限的私有存储库以及管理用户等。定价起价为 5000 美元/年

My concern is - I heard Git doesn't allow you to work on partial repos (based on PATH) So even if I need to work on say http://plugins.svn.wordpress.org/rtsocial/trunk, the entire repo will get downloaded. Is this true? Is there any workaroud for this?

Yes. You cannot check out only part of a repository

Use one repo per project. There is no other sensible way to organize things. You can implement a hierarchy via submodules, which allow you to include a separate repo as a "sub project" of a different repo.

Git depends on sane content boundaries to work well. If you try to dump "multiple thousands" of projects into a single Git repo, you will have an absolute unmanageable disaster, guaranteed.

On a final note, Git != GitHub. You are not required to pay for Git hosting on GitHub to use Git, and I can't see why you would since you obviously don't intend to use any of GitHub's social coding features with 1000+ private repositories.

Any machine can host a Git repository for people to push and pull from. Why not just install your "thousands" of repositories onto a cheap Linux-based server somewhere in your office? Anything with sufficient hard drive space to hold the projects will do, a 10 year old machine with a 100GB hard drive could do the job.

On sidenote, if Git prefers "one project = one repo", any alternative to GitHub where "unlimited private" repos are allowed?

GetHub sells the ability to licence and install a local copy of their software, called GitHub Firewall. You will be able to configure unlimited private repositories as well as administer users etc. Pricing starts at $5000/year.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文