公司自己搭建的Gitea服务,因为代码提交次数太多。最近在git clone的时候报错了。
报错如下
remote: Counting objects: 2314, done.
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header
原来是因为git clone会克隆所有发分支,当我们提交次数太多时就会报错。
解决办法:
git clone --depth=1 git:xxxxxxxx
即:获取最新提交的代码。