跳到主要内容

GitLab CI 报错 fatal: git fetch-pack: expected shallow list

· 阅读需 1 分钟

gitlab ci 执行流水线 Job 返回如下错误:

Reinitialized existing Git repository in /home/gitlab-runner/builds/AXzjdXyZ/0/root/blog/.git/
fatal: git fetch-pack: expected shallow list
fatal: The remote end hung up unexpectedly

原因是 centos 7 git 版本太老不持之新 API,需要升级一下 git:

#安装源
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
#安装git
yum install git
#更新git
yum update git