git clone时,报错 fatal: protocol error: bad pack header

转载于:https://blog.csdn.net/lishiyu93/article/details/114590784
亲测使用,保存文章,避免被原作者删除。

问题描述:

使用GitClone拉取项目时,如果存在项目文件过大而导致拉取失败的问题。如下图所示:
在这里插入图片描述

解决办法:

1)首先,在git bash 中依次输入一下几行命令:
git config --global pack.windowMemory “100m”
git config --global pack.SizeLimit “100m”
git config --global pack.threads 1
在这里插入图片描述

2)然后,克隆的时候调整Depth的值,根据实际情况自行调整值的大小。在使用git clone下载时,勾选下图中Depth选项:
在这里插入图片描述

注意这里的Depth的含义是:用于指定克隆深度,为1即表示只克隆最近一次commit。

猜你喜欢

转载自blog.csdn.net/qq_28644183/article/details/126702023