由于浅克隆,部署在 codeship 上失败

Deployment failed on codeship due to shallow clone

Codeship 拉取深度为 50 的克隆以加快构建过程。我们有一个超过 50 次提交的拉取请求(不常见但会发生)并且我们部署到催化失败并出现以下错误:

 Warning: Permanently added '<deployment host>
 to the list of known hosts.
 Counting objects: 6551, done.
 Delta compression using up to 32 threads.
 Compressing objects: 100% (2626/2626), done.
 Writing objects: 100% (6551/6551), 23.57 MiB | 16.37 MiB/s, done.
 Total 6551 (delta 3843), reused 6551 (delta 3843)
 To <>.git
 ! [remote rejected] dev -> master (shallow update not allowed)
 error: failed to push some refs to '<>.git'

压缩了一些提交后,我们能够部署,但是当我们有一个相当大的 PR 需要合并时,我们 运行 遇到了问题。避免错误

 ' ! [remote rejected] dev -> master (shallow update not allowed) '

我们将以下脚本添加到部署管道中,一切正常。

 if [ -f ${HOME}/clone/.git/shallow ]; then git fetch --unshallow; fi

我们将以下脚本添加到部署管道中,一切正常。

if [ -f ${HOME}/clone/.git/shallow ];然后 git fetch --unshallow;菲