git - fork 存储库时对存储的影响

标签 git github github-enterprise

场景:主存储库有超过 100 名开发人员在使用它

在 100 多个开发人员 fork 父存储库的情况下,对 Github 存储空间是否会产生重大影响,或者每个开发人员拥有自己的存储库 fork ,然后向父存储库提出 PR 是一个有效的策略?

我查看了其他几个可能与这个问题相关的线程,但只能发现 fork 共享对象以最大限度地减少存储使用。但是,我无法弄清楚大规模(数百个 fork )的影响程度以及这是否会显着占用可用存储空间。

最佳答案

GitHub 上的 fork 不会(在 GitHub 服务器端)复制完整存储库,如 Counting Objects 的“Vicent Martí”中所述。 2015年。

Very early on we figured out that actually forking people’s repositories was not sustainable.

For instance, there are almost 11,000 forks of Rails hosted on GitHub: if each one of them were its own copy of the repository, that would imply an incredible amount of redundant disk space, requiring several times more fileservers than the ones we have in our infrastructure.

That’s why we decided to use a feature of Git called alternates.

When you fork a repository on GitHub, we create a shallow copy of it.
This copy has no objects of its own, but it has access to all the objects of an alternate, a root repository we call network.git and which contains the objects for all the forks in the network.

关于git - fork 存储库时对存储的影响,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69305027/

相关文章:

git - 从 git 命令获取 JSON,比如 git status

git - 如何在 git pull 之前预览更改

git - 创建一个 GitHub webhook,用于何时接受 pull 请求并将其 merge 到 master

android - 在android studio中添加库?

php - 如何正确要求 Composer 中的特定提交,以便它可用于依赖包?

github-actions - GitHub Actions - 为多个存储库重用 secret 的最佳方法

github 服务器端 git 钩子(Hook)(即预提交和后提交)

git - sbt + Intellij IDEA : dependencies from git?

git - 警告 : push. 默认未设置;它的隐含值在 Git 2.0 中发生了变化

gitlab - 使用 https 推送,指定用户名和密码