git clone报错fatal: pack has bad object at offset 186137397: inflate returned 1

逐步拷贝

https://stackoverflow.com/questions/27653116/git-fatal-pack-has-bad-object-at-offset-x-inflate-returned-5

https://www.cnblogs.com/Lenbrother/p/17726195.html

https://cloud.tencent.com/developer/ask/sof/107092182

bash 复制代码
git clone --depth 1 <repository-url>
cd <repository-directory>
#然而还是失败
git fetch --unshallow

#均失败
git fetch --depth=100
git fetch --depth=50
git fetch --depth=40
#成功
git fetch --depth=30

#失败
git fetch --depth=35
git fetch --depth=31

发现出错的在31

获取期间的commit

bash 复制代码
$ git log --pretty=format:"%H" | sed -n '30,40p'
c736xxxx

由于是我自己的项目,所以我计划把这次提交的大文件删除掉,然后再下载代码

但是对应commit的文件其实已经不在了,已经被删了,所以其实无从下手

最后从是直接在git页面上点击download下载的代码

为了方便后期使用,我新建了一个git项目,然后把代码上传到该项目里了,后面计划就在这个项目里更新了

相关推荐
℘团子এ1 小时前
git中,项目怎么更换远程仓库连接地址
git
言之。7 小时前
Git Hooks
git
代码AI弗森7 小时前
Git Bash 与 PowerShell:定位差异、使用场景与选择建议
开发语言·git·bash
森叶9 小时前
Git flow command error: ‘flow‘ is not a git command 问题解决
git
天麓10 小时前
git merge 举例
git
AI_567811 小时前
Git冲突治理白皮书:智能标记与可视化协同的下一代解决方案
大数据·人工智能·git·机器学习
念丶小宇12 小时前
Git常用指令
大数据·git·elasticsearch
CSDN_RTKLIB12 小时前
Git Clone
git
中二病码农不会遇见C++学姐13 小时前
.env 文件是干啥的?为什么不能提交到 Git?
git·学习
CoderJia程序员甲14 小时前
GitHub 热榜项目 - 日榜(2026-02-03)
git·ai·开源·llm·github