gpt4 book ai didi

Git - 包超出最大允许大小 - 初始提交太大

转载 作者:行者123 更新时间:2023-12-05 06:39:22 27 4
gpt4 key购买 nike

这个问题与Git - pack exceeds maximum allowed size密切相关, 但有一个额外的转折。

我正在尝试将现有存储库迁移到 GitHub。就像在原始问题中一样,我收到“包超出最大允许大小”错误。不幸的是,推送多个提交的 block 并不能解决我的问题,因为单独的初始提交已经太大而无法通过(~6000 个文件,~1GiB)。该项目存在了好几年,直到它的所有文件最终都被移动到一个 git 仓库中。

有没有办法以某种方式拆分第一个提交以便将其推送到 GitHub(而不更改项目的整个历史记录)?我还能做什么?

最佳答案

关于 git repack --max-pack-size=...,Git 2.33(2021 年第 3 季度)现在更加清晰。

参见 commit 6fb9195 (2021 年 6 月 8 日)作者:Jeff King (peff) .
(由 Junio C Hamano -- gitster -- merge 于 commit 18b49be ,2021 年 7 月 8 日)

doc: warn people against --max-pack-size

Signed-off-by: Jeff King

This option is almost never a good idea, as the resulting repository is larger and slower (see the new explanations in the docs).

I outlined the potential problems.
We could go further and make the option harder to find (or at least, make the command-line option descriptions a much more terse "you probably don't want this; see pack.packsizeLimit for details").
But this seems like a minimal change that may prevent people from thinking it's more useful than it is.

git config 现在包含在其 man page 中:

Note that this option is rarely useful, and may result in a larger totalon-disk size (because Git will not store deltas between packs), as wellas worse runtime performance (object lookup within multiple packs isslower than a single pack, and optimizations like reachability bitmapscannot cope with multiple packs).

If you need to actively run Git using smaller packfiles (e.g., because yourfilesystem does not support large files), this option may help.

But ifyour goal is to transmit a packfile over a medium that supports limitedsizes (e.g., removable media that cannot store the whole repository),you are likely better off creating a single large packfile and splittingit using a generic multi-volume archive tool (e.g., Unix split).

The minimum size allowed is limited to 1 MiB. The default is unlimited.Common unit suffixes of 'k', 'm', or 'g' are supported.

git pack-objects 现在包含在其 man page 中:

Note that this option may result ina larger and slower repository; see the discussion inpack.packSizeLimit.

git repack 现在包含在其 man page 中:

Note that this option may result ina larger and slower repository; see the discussion inpack.packSizeLimit.

关于Git - 包超出最大允许大小 - 初始提交太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44635761/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com