gpt4 book ai didi

git - 自安装 Big Sur 以来,无法再通过 HTTPS git 克隆大型存储库

转载 作者:行者123 更新时间:2023-12-02 02:10:47 25 4
gpt4 key购买 nike

每当我尝试克隆大型存储库时,都会发生以下情况:

$ git clone https://github.com/yarnpkg/berry.git
Cloning into 'berry'...
remote: Enumerating objects: 60762, done.
remote: Counting objects: 100% (1155/1155), done.
remote: Compressing objects: 100% (588/588), done.
Receiving objects: 5% (3454/60762), 13.86 MiB | 4.60 MiB/ (etc etc)
fatal: fetch-pack: invalid index-pack output

我没有安装防病毒软件,也没有使用 VPN。我尝试连接到另一个网络,但没有解决问题,所以一定是大苏尔有什么问题导致了这个问题。我不知道还能尝试什么。

macOS 11.4、APFS+ 文件系统、git 2.31.1

我已经尝试过更改压缩设置,弄乱包大小设置,this post也没有帮助。我发布此内容是因为我已经尝试了迄今为止在互联网上看到的所有其他方法,但没有任何效果。

最佳答案

这应该是一条评论(因为它不是答案),但我需要一些格式和这里的很多空间。简而言之,您需要找出原因 git index-pack行为不端或失败。 (通过智能协议(protocol)获取通常会检索所谓的精简包,git fetch需要使用git index-pack --fix-thin来“增肥”。)

如果 git index-pack 的输出,则会发生“无效的索引包输出”错误不匹配什么git fetch-pack期望。 Here's the code involved :

char *index_pack_lockfile(int ip_out, int *is_well_formed)
{
char packname[GIT_MAX_HEXSZ + 6];
const int len = the_hash_algo->hexsz + 6;

/*
* The first thing we expect from index-pack's output
* is "pack\t%40s\n" or "keep\t%40s\n" (46 bytes) where
* %40s is the newly created pack SHA1 name. In the "keep"
* case, we need it to remove the corresponding .keep file
* later on. If we don't get that then tough luck with it.
*/
if (read_in_full(ip_out, packname, len) == len && packname[len-1] == '\n') {
const char *name;

if (is_well_formed)
*is_well_formed = 1;
packname[len-1] = 0;
if (skip_prefix(packname, "keep\t", &name))
return xstrfmt("%s/pack/pack-%s.keep",
get_object_directory(), name);
return NULL;
}
if (is_well_formed)
*is_well_formed = 0;
return NULL;
}

这是从 fetch-pack.c 运行的的 get_pack function ,运行 git index-pack基于很多变量的参数。如果您运行 git clone与环境变量GIT_TRACE设置为1,可以观察Git运行git index-pack 。调用index_pack_lockfile仅当 do_keep 时才会发生这种情况设置,基于args->keep_pack最初,但如果包头的 hdr_entries 则可以设置值等于或超过unpack_limit (参见第 859 行附近)。

您可以控制unpack_limit值使用 fetch.unpackLimit 和/或 transfer.unpackLimit 。默认值是 100。您也许可以使用这些来解决索引包的一些问题,但索引包不应该以任何方式失败。注意,如果你想强制git fetch使用git unpack-objects相反,您还必须禁用对象检查 ( fsck_objects )。

运行 git index-pack 可能会很有趣也直接在 git fetch 检索到的数据上。 (考虑安装 shell 脚本来代替正常的 git index-pack ,其中脚本打印其参数,然后在其自己的进程组上使用 kill -STOP ,以便您可以检查临时文件。)

关于git - 自安装 Big Sur 以来,无法再通过 HTTPS git 克隆大型存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67778629/

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