如何减少GIT回购中最大的树木条目?

发布于 2025-02-13 18:08:31 字数 1436 浏览 0 评论 0原文

我的存储库变得非常慢,要调试我安装了git-sizer。

我从git-sizer输出中看到:

| Biggest objects              |           |                                |
| * Commits                    |           |                                |
|   * Maximum size         [1] |   734 B   |                                |
|   * Maximum parents      [2] |     2     |                                |
| * Trees                      |           |                                |
|   * Maximum entries      [3] |  33.1 k   | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| * Blobs                      |           |                                |
|   * Maximum size         [4] |  90.5 MiB | *********                      |

| Biggest checkouts            |           |                                |
| * Number of directories  [5] |  2.30 k   | *                              |
| * Maximum path depth     [6] |     8     |                                |
| * Maximum path length    [6] |   156 B   | *                              |
| * Number of files        [5] |   348 k   | ****                           |

对于我的回购“最大条目”,如图所示。 !”。

但是,文件数并不是那么糟糕的“ ****”。

那么这里发生了什么?

有什么方法可以减少GIT存储库的“最大条目”?

我已经尝试了:

git reflog expire --expire=now --all
git gc --prune=now


git push origin --force --all
git push origin --force --tags

rm -rf .git/refs/original/

git fetch
git reset origin/main --hard

My repo became very slow and to debug it I installed git-sizer.

I see from git-sizer output:

| Biggest objects              |           |                                |
| * Commits                    |           |                                |
|   * Maximum size         [1] |   734 B   |                                |
|   * Maximum parents      [2] |     2     |                                |
| * Trees                      |           |                                |
|   * Maximum entries      [3] |  33.1 k   | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| * Blobs                      |           |                                |
|   * Maximum size         [4] |  90.5 MiB | *********                      |

| Biggest checkouts            |           |                                |
| * Number of directories  [5] |  2.30 k   | *                              |
| * Maximum path depth     [6] |     8     |                                |
| * Maximum path length    [6] |   156 B   | *                              |
| * Number of files        [5] |   348 k   | ****                           |

For my repo "Maximum entries" is reaching limit as shown "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!".

But the number of files is not that bad "****".

So whats happening here?

Is there a way I can reduce the "Maximum entries" for my git repo?

I have already tried:

git reflog expire --expire=now --all
git gc --prune=now


git push origin --force --all
git push origin --force --tags

rm -rf .git/refs/original/

git fetch
git reset origin/main --hard

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文